Add effect support for light strips (#293)

* Add effect support for KL430

* KL400 supports effects

* Add KL400 fixture

* Comments from review

* actually commit the remove
This commit is contained in:
J. Nick Koston
2022-03-21 11:10:12 -10:00
committed by GitHub
parent b22f6b4eef
commit 58f6517445
8 changed files with 508 additions and 2 deletions

View File

@@ -359,6 +359,10 @@ class FakeTransportProtocol(TPLinkSmartHomeProtocol):
self.proto["system"]["get_sysinfo"]["relay_state"] = 1
self.proto["system"]["get_sysinfo"]["brightness"] = x["brightness"]
def set_lighting_effect(self, effect, *args):
_LOGGER.debug("Setting light effect to %s", effect)
self.proto["system"]["get_sysinfo"]["lighting_effect_state"] = dict(effect)
def transition_light_state(self, state_changes, *args):
_LOGGER.debug("Setting light state to %s", state_changes)
light_state = self.proto["system"]["get_sysinfo"]["light_state"]
@@ -422,6 +426,9 @@ class FakeTransportProtocol(TPLinkSmartHomeProtocol):
"get_light_state": light_state,
"transition_light_state": transition_light_state,
},
"smartlife.iot.lighting_effect": {
"set_lighting_effect": set_lighting_effect,
},
# lightstrip follows the same payloads but uses different module & method
"smartlife.iot.lightStrip": {
"set_light_state": transition_light_state,