mirror of
https://github.com/home-assistant/core.git
synced 2025-04-22 16:27:56 +00:00
Add unique id to mold_indicator setup from yaml (#126992)
This commit is contained in:
parent
e87542e091
commit
0b3d69aa8e
@ -20,6 +20,7 @@ from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import (
|
||||
ATTR_UNIT_OF_MEASUREMENT,
|
||||
CONF_NAME,
|
||||
CONF_UNIQUE_ID,
|
||||
PERCENTAGE,
|
||||
STATE_UNKNOWN,
|
||||
UnitOfTemperature,
|
||||
@ -64,6 +65,7 @@ PLATFORM_SCHEMA = SENSOR_PLATFORM_SCHEMA.extend(
|
||||
vol.Required(CONF_INDOOR_HUMIDITY): cv.entity_id,
|
||||
vol.Optional(CONF_CALIBRATION_FACTOR): vol.Coerce(float),
|
||||
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
|
||||
vol.Optional(CONF_UNIQUE_ID): cv.string,
|
||||
}
|
||||
)
|
||||
|
||||
@ -80,6 +82,7 @@ async def async_setup_platform(
|
||||
outdoor_temp_sensor: str = config[CONF_OUTDOOR_TEMP]
|
||||
indoor_humidity_sensor: str = config[CONF_INDOOR_HUMIDITY]
|
||||
calib_factor: float = config[CONF_CALIBRATION_FACTOR]
|
||||
unique_id: str | None = config.get(CONF_UNIQUE_ID)
|
||||
|
||||
async_add_entities(
|
||||
[
|
||||
@ -91,7 +94,7 @@ async def async_setup_platform(
|
||||
outdoor_temp_sensor,
|
||||
indoor_humidity_sensor,
|
||||
calib_factor,
|
||||
None,
|
||||
unique_id,
|
||||
)
|
||||
],
|
||||
False,
|
||||
|
Loading…
x
Reference in New Issue
Block a user