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:
nopoz
2026-10-04 07:01:50 -07:00
committed by GitHub
parent dc0745ad93
commit effdf5a298
3 changed files with 81 additions and 1 deletions

View File

@@ -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):