diff --git a/custom_components/hilo/switch.py b/custom_components/hilo/switch.py index 4360417..7402d15 100644 --- a/custom_components/hilo/switch.py +++ b/custom_components/hilo/switch.py @@ -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")