diff --git a/homeassistant/components/rainforest_eagle/sensor.py b/homeassistant/components/rainforest_eagle/sensor.py index 113cfceb7d6..987142c6390 100644 --- a/homeassistant/components/rainforest_eagle/sensor.py +++ b/homeassistant/components/rainforest_eagle/sensor.py @@ -75,11 +75,13 @@ class EagleSensor(CoordinatorEntity[EagleDataCoordinator], SensorEntity): """Initialize the sensor.""" super().__init__(coordinator) self.entity_description = entity_description - - @property - def unique_id(self) -> str | None: - """Return unique ID of entity.""" - return f"{self.coordinator.cloud_id}-${self.coordinator.hardware_address}-{self.entity_description.key}" + self._attr_unique_id = f"{coordinator.cloud_id}-${coordinator.hardware_address}-{entity_description.key}" + self._attr_device_info = DeviceInfo( + identifiers={(DOMAIN, coordinator.cloud_id)}, + manufacturer="Rainforest Automation", + model=coordinator.model, + name=coordinator.model, + ) @property def available(self) -> bool: @@ -90,13 +92,3 @@ class EagleSensor(CoordinatorEntity[EagleDataCoordinator], SensorEntity): def native_value(self) -> StateType: """Return native value of the sensor.""" return self.coordinator.data.get(self.entity_description.key) - - @property - def device_info(self) -> DeviceInfo: - """Return device info.""" - return DeviceInfo( - identifiers={(DOMAIN, self.coordinator.cloud_id)}, - manufacturer="Rainforest Automation", - model=self.coordinator.model, - name=self.coordinator.model, - )