Skip to content

Commit

Permalink
Merge pull request #2 from clem-25/patch-1
Browse files Browse the repository at this point in the history
Add Toggle switch
  • Loading branch information
remialban authored Sep 5, 2024
2 parents 0e89e88 + dc9e000 commit cb583ba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom_components/ipx800v3/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,9 @@ async def async_turn_off(self, **kwargs: Any):
await self._api.call_api("preset.htm?led" + str(self._pin) + "=0")
await self.coordinator.async_refresh()

async def async_toggle(self, **kwargs: Any):
await self._api.call_api("leds.cgi?led=" + str(self._pin-1))
await self.coordinator.async_refresh()

def set_state(self, state: bool):
self._attr_is_on = state

0 comments on commit cb583ba

Please sign in to comment.