diff --git a/custom_components/iaquk/sensor.py b/custom_components/iaquk/sensor.py index 7e67644..86b66c1 100644 --- a/custom_components/iaquk/sensor.py +++ b/custom_components/iaquk/sensor.py @@ -65,12 +65,12 @@ def __init__(self, controller, sensor_type: str): """Initialize sensor.""" self._controller = controller self._sensor_type = sensor_type + self._attr_unique_id = f"{controller.unique_id}_{sensor_type}" self.entity_id = async_generate_entity_id( ENTITY_ID_FORMAT, self._attr_unique_id, hass=controller.hass ) - self._attr_unique_id = f"{controller.unique_id}_{sensor_type}" self._attr_name = f"{controller.name} {SENSORS[sensor_type]}" self._attr_state_class = ( SensorStateClass.MEASUREMENT if sensor_type == SENSOR_INDEX else None