mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-10-15 00:54:14 +00:00
Expose the light transition state change flag (#1745)
Bulbs and light strips can fade smoothly when their brightness or colour changes, instead of snapping straight to the new value. The Tapo app exposes this as "Smooth Transition". python-kasa cannot read or change it today, so the setting is missing from Home Assistant even though the device supports it. This adds support for this feature as a switch: - read `change_state` in `_post_update_hook` - add a `change_transition` property and `set_change_transition()` - register a `smooth_transition_change` switch feature when the device reports the flag
This commit is contained in:
@@ -480,6 +480,12 @@ class FakeSmartTransport(BaseTransport):
|
||||
info["get_on_off_gradually_info"]["off_state"]["duration"] = (
|
||||
off_state["duration"]
|
||||
)
|
||||
elif (change_state := params.get("change_state")) and (
|
||||
"get_on_off_gradually_info" in info
|
||||
):
|
||||
info["get_on_off_gradually_info"]["change_state"]["enable"] = change_state[
|
||||
"enable"
|
||||
]
|
||||
return {"error_code": 0}
|
||||
|
||||
def _set_dynamic_light_effect(self, info, params):
|
||||
|
||||
Reference in New Issue
Block a user