Do not send light_on value to iot bulb set_state (#1090)

Passing this extra value caused the `ignore_default` check in the `IotBulb._set_light_state`
method to fail which causes the device to come back on to the default state.
This commit is contained in:
Steven B.
2024-07-31 15:56:07 +01:00
committed by GitHub
parent cb7e904d30
commit cb0077f634
3 changed files with 20 additions and 1 deletions

View File

@@ -230,6 +230,8 @@ class Light(IotModule, LightInterface):
state_dict["on_off"] = 1
else:
state_dict["on_off"] = int(state.light_on)
# Remove the light_on from the dict
state_dict.pop("light_on", None)
return await bulb._set_light_state(state_dict, transition=transition)
@property