Add unique id to mold_indicator (#126990)

This commit is contained in:
G Johansson 2024-09-28 14:53:40 +02:00 committed by GitHub
parent 52c358e120
commit 85a9a8eca1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -162,6 +162,7 @@ def ws_start_preview(
outdoor_temp,
indoor_hum,
msg["user_input"].get(CONF_CALIBRATION_FACTOR),
None,
)
preview_entity.hass = hass

View File

@ -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 @@ class MoldIndicator(SensorEntity):
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