Skip to content

Commit

Permalink
Changing icon for switches to power-plug
Browse files Browse the repository at this point in the history
  • Loading branch information
valleedelisle committed Jan 16, 2022
1 parent a72a3cd commit 41c9ffa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions custom_components/hilo/switch.py
Expand Up @@ -31,6 +31,14 @@ def __init__(self, hilo: Hilo, device):
def state(self):
return self._device.state

@property
def icon(self):
if not self._device.available:
return "mdi:lan-disconnect"
if self.state == "on":
return "mdi:power-plug"
return "mdi:power-plug-off"

@property
def is_on(self):
return self._device.get_value("is_on")
Expand Down

0 comments on commit 41c9ffa

Please sign in to comment.