diff --git a/homeassistant/components/tplink/icons.json b/homeassistant/components/tplink/icons.json new file mode 100644 index 00000000000..9b83b3abc85 --- /dev/null +++ b/homeassistant/components/tplink/icons.json @@ -0,0 +1,16 @@ +{ + "entity": { + "switch": { + "led": { + "default": "mdi:led-off", + "state": { + "on": "mdi:led-on" + } + } + } + }, + "services": { + "sequence_effect": "mdi:playlist-play", + "random_effect": "mdi:shuffle-variant" + } +} diff --git a/homeassistant/components/tplink/switch.py b/homeassistant/components/tplink/switch.py index 3e81870d80f..8d64fc73147 100644 --- a/homeassistant/components/tplink/switch.py +++ b/homeassistant/components/tplink/switch.py @@ -61,7 +61,7 @@ class SmartPlugLedSwitch(CoordinatedTPLinkEntity, SwitchEntity): ) -> None: """Initialize the LED switch.""" super().__init__(device, coordinator) - self._attr_unique_id = f"{self.device.mac}_led" + self._attr_unique_id = f"{device.mac}_led" self._async_update_attrs() @async_refresh_after @@ -77,9 +77,7 @@ class SmartPlugLedSwitch(CoordinatedTPLinkEntity, SwitchEntity): @callback def _async_update_attrs(self) -> None: """Update the entity's attributes.""" - is_on = self.device.led - self._attr_is_on = is_on - self._attr_icon = "mdi:led-on" if is_on else "mdi:led-off" + self._attr_is_on = self.device.led @callback def _handle_coordinator_update(self) -> None: