diff --git a/homeassistant/components/elmax/binary_sensor.py b/homeassistant/components/elmax/binary_sensor.py index 6eb4cd654c5..0defbe464f9 100644 --- a/homeassistant/components/elmax/binary_sensor.py +++ b/homeassistant/components/elmax/binary_sensor.py @@ -60,12 +60,9 @@ async def async_setup_entry( class ElmaxSensor(ElmaxEntity, BinarySensorEntity): """Elmax Sensor entity implementation.""" + _attr_device_class = BinarySensorDeviceClass.DOOR + @property def is_on(self) -> bool: """Return true if the binary sensor is on.""" return self.coordinator.get_zone_state(self._device.endpoint_id).opened - - @property - def device_class(self) -> BinarySensorDeviceClass: - """Return the class of this device, from component DEVICE_CLASSES.""" - return BinarySensorDeviceClass.DOOR diff --git a/homeassistant/components/elmax/common.py b/homeassistant/components/elmax/common.py index b593ae399f4..440344fb839 100644 --- a/homeassistant/components/elmax/common.py +++ b/homeassistant/components/elmax/common.py @@ -157,35 +157,16 @@ class ElmaxEntity(CoordinatorEntity[ElmaxCoordinator]): super().__init__(coordinator=coordinator) self._panel = panel self._device = elmax_device - self._panel_version = panel_version - self._client = coordinator.http_client - - @property - def panel_id(self) -> str: - """Retrieve the panel id.""" - return self._panel.hash - - @property - def unique_id(self) -> str | None: - """Provide a unique id for this entity.""" - return self._device.endpoint_id - - @property - def name(self) -> str | None: - """Return the entity name.""" - return self._device.name - - @property - def device_info(self) -> DeviceInfo: - """Return device specific attributes.""" - return DeviceInfo( - identifiers={(DOMAIN, self._panel.hash)}, - name=self._panel.get_name_by_user( - self.coordinator.http_client.get_authenticated_username() + self._attr_unique_id = elmax_device.endpoint_id + self._attr_name = elmax_device.name + self._attr_device_info = DeviceInfo( + identifiers={(DOMAIN, panel.hash)}, + name=panel.get_name_by_user( + coordinator.http_client.get_authenticated_username() ), manufacturer="Elmax", - model=self._panel_version, - sw_version=self._panel_version, + model=panel_version, + sw_version=panel_version, ) @property diff --git a/homeassistant/components/elmax/switch.py b/homeassistant/components/elmax/switch.py index 431e75a0883..877330892e5 100644 --- a/homeassistant/components/elmax/switch.py +++ b/homeassistant/components/elmax/switch.py @@ -68,7 +68,7 @@ class ElmaxSwitch(ElmaxEntity, SwitchEntity): return self.coordinator.get_actuator_state(self._device.endpoint_id).opened async def _wait_for_state_change(self) -> bool: - """Refresh data and wait until the state state changes.""" + """Refresh data and wait until the state changes.""" old_state = self.coordinator.get_actuator_state(self._device.endpoint_id).opened # Wait a bit at first to let Elmax cloud assimilate the new state.