feat: apply segment effect rule for RGBIC strips#463
feat: apply segment effect rule for RGBIC strips#463mihai-dinculescu merged 9 commits intomihai-dinculescu:mainfrom
Conversation
|
Thank you for bringing this to my attention. I wasn’t aware that the app had introduced so many new effects, some of which rely on the new If I understand correctly, I’d be keen to add support for this new functionality, but I want to do so in a way that’s user-friendly and consistent with the existing It looks like someone has already done significant work dumping all of the segment effects defined by the app. This could be very useful: python-kasa/python-kasa#975. |
|
Thanks for the feedback! Yes, that's a fair assumption. I'm fairly new to the Tapo ecosystem and only recently got around to setting up my L920 and from my testing the app seems to push most (if not all) the lighting effects for this specific strip through
I reworked the PR to add I validated on L920 that all 55 app presets work with the minimal payloads (just Currently I'm missing a few values from the Let me know if this direction is closer to what you had in mind, happy to revise further. |
|
This looks great 🎉 Once the missing effects are added, Python support is in place, and the Rust and Python examples are updated to showcase this new functionality, it should be ready to ship! |
|
Thank you! Confirming I have now added the missing I also updated the SUPPORTED_DEVICES.md matrix as well as the existing Rust and Python examples showcasing the functionality. |
|
Thank you so much for this. It's a fantastic contribution! |
What
Expose app-defined RGBIC segment effects with a
set_segment_effectAPI that accepts either aSegmentEffectPresetor a customSegmentEffect.Why
L920/L930app RGBIC effects are sent viaapply_segment_effect_ruleand cannot be expressed withLightingEffect, so users cannot automate them today.Changes
Added
SegmentEffect(custom) andSegmentEffectPreset(app defaults) with builder helpers and a typedSegmentEffectType.Added
set_segment_effecton the handler plus API client support for theapply_segment_effect_ruleendpoint.Notes
I didn't update the Python bindings/stubs yet because I wasn't sure if this feature is in scope for the library overall (or if there's a preferred approach). Happy to revise or extend this based on feedback! 🤠
Testing
Verified on
Tapo L920using app-captured effect payloads and preset IDs.Firmware:
1.1.11Build250313 Rel.095031Hardware Version:
1.0Confirmed
apply_segment_effect_rulesucceeds only when bothsegmentsandstatesare provided for custom effects; omitting either returnsInvalidParameters. Preset payloads (name/id/brightness/display_colors) work.Before
No public API for
apply_segment_effect_rule; segment effects were not controllable from the library.After
Example usage: