diff --git a/homeassistant/components/mold_indicator/config_flow.py b/homeassistant/components/mold_indicator/config_flow.py index fc5c5ee953b1ae..8f2c212ade0f65 100644 --- a/homeassistant/components/mold_indicator/config_flow.py +++ b/homeassistant/components/mold_indicator/config_flow.py @@ -162,6 +162,7 @@ def async_preview_updated(state: str, attributes: Mapping[str, Any]) -> None: outdoor_temp, indoor_hum, msg["user_input"].get(CONF_CALIBRATION_FACTOR), + None, ) preview_entity.hass = hass diff --git a/homeassistant/components/mold_indicator/sensor.py b/homeassistant/components/mold_indicator/sensor.py index 6aaee817016857..de949ab72d845f 100644 --- a/homeassistant/components/mold_indicator/sensor.py +++ b/homeassistant/components/mold_indicator/sensor.py @@ -91,6 +91,7 @@ async def async_setup_platform( outdoor_temp_sensor, indoor_humidity_sensor, calib_factor, + None, ) ], False, @@ -119,6 +120,7 @@ async def async_setup_entry( outdoor_temp_sensor, indoor_humidity_sensor, calib_factor, + entry.entry_id, ) ], False, @@ -142,10 +144,12 @@ def __init__( outdoor_temp_sensor: str, indoor_humidity_sensor: str, calib_factor: float, + unique_id: str | None, ) -> None: """Initialize the sensor.""" self._state: str | None = None self._attr_name = name + self._attr_unique_id = unique_id self._indoor_temp_sensor = indoor_temp_sensor self._indoor_humidity_sensor = indoor_humidity_sensor self._outdoor_temp_sensor = outdoor_temp_sensor