Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix homekit handling of 0 light brightness and fan speed #29962
Replaces the fix in #27076.
When you turn on a HomeKit accessory it will try and restore the last brightness/rotation speed. But if it is set to 0%, HomeKit will update the brightness to 100% as it thinks 0% is off. This leads to unexpected behaviors such as:
I tried to do a screen recording to document this bug but it seems I need a proper camera to capture what is going on. It was more obvious on v100, but ever since I updated to v103 I cannot easily show it on the screen recording any more because the actual device brightness de-syncs from the Home app.
How is it fixed:
Please see code comments to see more details.
Example entry for
-Light already on at minimum brightness
-Light already on at minimum brightness (now mapped to 1%)
Sorry for the music, had to mute the audio but cant find the option on Youtube.
Of course there is countless other scenarios and devices not covered by these videos. But I just want to show you what I'm dealing with here. I believe the changes in this patch will result in the best experience for most devices. Devices should not report 0 brightness and rotation speed anyway so if it breaks for them technically they only work previously by accident.