| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
on_off_gradually reports three flags: on_state and off_state, which cover fading when the light is turned on and off and are already exposed as number features, and change_state, which was neither read nor written. change_state controls fading between states while the light is already on, and is what the Tapo app presents as "Smooth Transition". Verified on an L920 running firmware 1.4.4: with the flag cleared a brightness jump snaps instantly, and with it set the same jump ramps. Only newer firmware reports it, so the feature is registered only when the device returns the flag. The check uses the parsed value rather than the raw data because _initialize_features must not raise for devices whose get_on_off_gradually_info query failed.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## master #1745 +/- ##
=======================================
Coverage 93.29% 93.30%
=======================================
Files 157 157
Lines 9932 9945 +13
Branches 1022 1025 +3
=======================================
+ Hits 9266 9279 +13
Misses 471 471
Partials 195 195 ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
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 PR adds it as a switch.
Under the hood, on_off_gradually reports three flags. on_state and off_state cover fading when the light is turned on and off, and are already exposed as the smooth_transition_on / smooth_transition_off number features. The third, change_state, appears nowhere in lighttransition.py: it is never read and never written, and set_enabled() only touches the other two.
Verification
Confirmed on a physical L920 running firmware 1.4.4, on_off_gradually v4, by toggling the flag and watching the strip. With change_state cleared, a brightness jump from 10 to 100 snaps instantly. With it set, the same jump ramps. Turn-on and turn-off fades were unaffected in both cases, which is the expected split with on_state / off_state.
The flag persists across a full disconnect, so it is stored device state rather than a per-session toggle.
Notes
Test plan