Change fields allowed to change in options flow for Mold indicator (#132400)

This commit is contained in:
G Johansson 2024-12-10 08:20:28 +01:00 committed by GitHub
parent e83a50b88d
commit 580a8d66b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 9 deletions

View File

@ -51,15 +51,6 @@ async def validate_input(
DATA_SCHEMA_OPTIONS = vol.Schema(
{
vol.Required(CONF_CALIBRATION_FACTOR): NumberSelector(
NumberSelectorConfig(step=0.1, mode=NumberSelectorMode.BOX)
)
}
)
DATA_SCHEMA_CONFIG = vol.Schema(
{
vol.Required(CONF_NAME, default=DEFAULT_NAME): TextSelector(),
vol.Required(CONF_INDOOR_TEMP): EntitySelector(
EntitySelectorConfig(
domain=Platform.SENSOR, device_class=SensorDeviceClass.TEMPERATURE
@ -75,6 +66,15 @@ DATA_SCHEMA_CONFIG = vol.Schema(
domain=Platform.SENSOR, device_class=SensorDeviceClass.TEMPERATURE
)
),
vol.Required(CONF_CALIBRATION_FACTOR): NumberSelector(
NumberSelectorConfig(step=0.1, mode=NumberSelectorMode.BOX)
),
}
)
DATA_SCHEMA_CONFIG = vol.Schema(
{
vol.Required(CONF_NAME, default=DEFAULT_NAME): TextSelector(),
}
).extend(DATA_SCHEMA_OPTIONS.schema)

View File

@ -70,6 +70,9 @@ async def test_options_flow(hass: HomeAssistant, loaded_entry: MockConfigEntry)
result = await hass.config_entries.options.async_configure(
result["flow_id"],
user_input={
CONF_INDOOR_TEMP: "sensor.indoor_temp",
CONF_INDOOR_HUMIDITY: "sensor.indoor_humidity",
CONF_OUTDOOR_TEMP: "sensor.outdoor_temp",
CONF_CALIBRATION_FACTOR: 3.0,
},
)