diff --git a/homeassistant/components/wake_on_lan/switch.py b/homeassistant/components/wake_on_lan/switch.py index eba6897647b5..4bbd1522c91b 100644 --- a/homeassistant/components/wake_on_lan/switch.py +++ b/homeassistant/components/wake_on_lan/switch.py @@ -14,6 +14,7 @@ from homeassistant.const import ( CONF_MAC, CONF_NAME, ) +from homeassistant.helpers import device_registry as dr import homeassistant.helpers.config_validation as cv from homeassistant.helpers.script import Script @@ -87,6 +88,7 @@ class WolSwitch(SwitchEntity): ) self._state = False self._assumed_state = host is None + self._unique_id = dr.format_mac(mac_address) @property def is_on(self): @@ -108,6 +110,11 @@ class WolSwitch(SwitchEntity): """Return false if assumed state is true.""" return not self._assumed_state + @property + def unique_id(self): + """Return the unique id of this switch.""" + return self._unique_id + def turn_on(self, **kwargs): """Turn the device on.""" service_kwargs = {}