Add missing unit of measurement for tolerance option in proximity (#111876)

This commit is contained in:
Michael 2024-02-29 22:16:27 +01:00 committed by GitHub
parent b0ed8c4961
commit 2a135b64b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,7 +14,7 @@ from homeassistant.config_entries import (
ConfigFlowResult, ConfigFlowResult,
OptionsFlow, OptionsFlow,
) )
from homeassistant.const import CONF_ZONE from homeassistant.const import CONF_ZONE, UnitOfLength
from homeassistant.core import State, callback from homeassistant.core import State, callback
from homeassistant.helpers.selector import ( from homeassistant.helpers.selector import (
EntitySelector, EntitySelector,
@ -54,7 +54,9 @@ def _base_schema(user_input: dict[str, Any]) -> vol.Schema:
CONF_TOLERANCE, CONF_TOLERANCE,
default=user_input.get(CONF_TOLERANCE, DEFAULT_TOLERANCE), default=user_input.get(CONF_TOLERANCE, DEFAULT_TOLERANCE),
): NumberSelector( ): NumberSelector(
NumberSelectorConfig(min=1, max=100, step=1), NumberSelectorConfig(
min=1, max=100, step=1, unit_of_measurement=UnitOfLength.METERS
),
), ),
} }