Skip to content

Commit

Permalink
Add unique id to mold_indicator (home-assistant#126990)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjohansson-ST authored Sep 28, 2024
1 parent 52c358e commit 85a9a8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions homeassistant/components/mold_indicator/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions homeassistant/components/mold_indicator/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ async def async_setup_platform(
outdoor_temp_sensor,
indoor_humidity_sensor,
calib_factor,
None,
)
],
False,
Expand Down Expand Up @@ -119,6 +120,7 @@ async def async_setup_entry(
outdoor_temp_sensor,
indoor_humidity_sensor,
calib_factor,
entry.entry_id,
)
],
False,
Expand All @@ -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
Expand Down

0 comments on commit 85a9a8e

Please sign in to comment.