Skip to content

Commit

Permalink
Fix turn_on for TX Ultimate Ambient Light #1369
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Jan 30, 2025
1 parent 23b1d2a commit 194c207
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions custom_components/sonoff/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -1230,18 +1230,11 @@ def set_state(self, params: dict):
(k for k, v in T5_EFFECTS.items() if v == params["lightMode"]), None
)

async def async_turn_on(
self, brightness: int = None, effect: str = None, **kwargs
) -> None:
params = {}

if effect and effect in T5_EFFECTS:
params["lightMode"] = T5_EFFECTS[effect]
async def async_turn_on(self, effect: str = None, **kwargs) -> None:
if value := T5_EFFECTS.get(effect):
await self.ewelink.send(self.device, {"lightMode": value})

if not params:
params["lightSwitch"] = "on"

await self.ewelink.send(self.device, params)
await self.ewelink.send(self.device, {"lightSwitch": "on"})

async def async_turn_off(self, **kwargs) -> None:
await self.ewelink.send(self.device, {"lightSwitch": "off"})

0 comments on commit 194c207

Please sign in to comment.