Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IRHaierAC160 light toggle only working every 2nd time #2081

Open
dneuhaeuser opened this issue Apr 2, 2024 · 0 comments
Open

IRHaierAC160 light toggle only working every 2nd time #2081

dneuhaeuser opened this issue Apr 2, 2024 · 0 comments

Comments

@dneuhaeuser
Copy link

dneuhaeuser commented Apr 2, 2024

I am using the IRHaierAC160 implementation with ESPHome and everything is working great so far, except the light toggle switch.
currently it only changes the light status every 2nd press.

As is mentioned in the code this light setting is kind of special because it is only controlled by the button code (0x15) in byte 13.
But the light button on the remote control works more like a pushbutton than a switch.
Each time you press it, it sends the exact same code for switching the light on or off.

But the function setLightToggle sets the button depending on bool value to different codes.

_.Button = on ? kHaierAc160ButtonLight : kHaierAcYrw02ButtonPower;

I think this is wrong. It has to set _.Button = kHaierAc160ButtonLight every time.

Because of this the getLightToggle function unfortunately is useless here, because with this protocol there is no way of knowing the current state of the light.

return _.Button == kHaierAc160ButtonLight;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant