diff --git a/homeassistant/components/anel_pwrctrl/switch.py b/homeassistant/components/anel_pwrctrl/switch.py index 0669a3bb6c6..2f4ce0ee7db 100644 --- a/homeassistant/components/anel_pwrctrl/switch.py +++ b/homeassistant/components/anel_pwrctrl/switch.py @@ -65,25 +65,13 @@ class PwrCtrlSwitch(SwitchEntity): """Initialize the PwrCtrl switch.""" self._port = port self._parent_device = parent_device - - @property - def unique_id(self): - """Return the unique ID of the device.""" - return f"{self._port.device.host}-{self._port.get_index()}" - - @property - def name(self): - """Return the name of the device.""" - return self._port.label - - @property - def is_on(self): - """Return true if the device is on.""" - return self._port.get_state() + self._attr_unique_id = f"{port.device.host}-{port.get_index()}" + self._attr_name = port.label def update(self): """Trigger update for all switches on the parent device.""" self._parent_device.update() + self._attr_is_on = self._port.get_state() def turn_on(self, **kwargs): """Turn the switch on."""