Fix homekit handling of 0 light brightness and fan speed (#29962)
* Fix homekit handling of 0 light brightness and fan speed * Update homekit tests for new initial brightness/speed value
This commit is contained in:
1 parent
20a0557be7
commit
488f26d55b
4 files changed
+46
-6
No files matched your search
@@ -197,7 +197,10 @@ async def test_fan_speed(hass, hk_driver, cls, events):
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
acc = cls.fan(hass, hk_driver, "Fan", entity_id, 2, None)
|
||||
assert acc.char_speed.value == 0
|
||||
|
||||
# Initial value can be anything but 0. If it is 0, it might cause HomeKit to set the
|
||||
# speed to 100 when turning on a fan on a freshly booted up server.
|
||||
assert acc.char_speed.value != 0
|
||||
|
||||
await hass.async_add_job(acc.run)
|
||||
assert (
|
||||
|
||||
@@ -101,7 +101,9 @@ async def test_light_brightness(hass, hk_driver, cls, events):
|
||||
await hass.async_block_till_done()
|
||||
acc = cls.light(hass, hk_driver, "Light", entity_id, 2, None)
|
||||
|
||||
assert acc.char_brightness.value == 0
|
||||
# Initial value can be anything but 0. If it is 0, it might cause HomeKit to set the
|
||||
# brightness to 100 when turning on a light on a freshly booted up server.
|
||||
assert acc.char_brightness.value != 0
|
||||
|
||||
await hass.async_add_job(acc.run)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
Reference in new issue
Block a user