mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-12-22 20:50:22 +00:00
Fix iot light effect brightness (#1092)
Fixes issue where the brightness of the `iot` light effect is set properly on the light effect but read back incorrectly from the light.
This commit is contained in:
@@ -271,13 +271,14 @@ class FakeSmartTransport(BaseTransport):
|
||||
|
||||
def _set_light_strip_effect(self, info, params):
|
||||
"""Set or remove values as per the device behaviour."""
|
||||
info["get_device_info"]["lighting_effect"]["enable"] = params["enable"]
|
||||
info["get_device_info"]["lighting_effect"]["name"] = params["name"]
|
||||
info["get_device_info"]["lighting_effect"]["id"] = params["id"]
|
||||
# Brightness is not always available
|
||||
if (brightness := params.get("brightness")) is not None:
|
||||
info["get_device_info"]["lighting_effect"]["brightness"] = brightness
|
||||
info["get_lighting_effect"] = copy.deepcopy(params)
|
||||
if "enable" in params:
|
||||
info["get_device_info"]["lighting_effect"]["enable"] = params["enable"]
|
||||
info["get_device_info"]["lighting_effect"]["name"] = params["name"]
|
||||
info["get_device_info"]["lighting_effect"]["id"] = params["id"]
|
||||
info["get_lighting_effect"] = copy.deepcopy(params)
|
||||
|
||||
def _set_led_info(self, info, params):
|
||||
"""Set or remove values as per the device behaviour."""
|
||||
|
||||
Reference in New Issue
Block a user