Add some more VolDictType annotations (#120610)

This commit is contained in:
Marc Mueller 2024-06-26 22:44:43 +02:00 committed by GitHub
parent fcfb580f0c
commit 6bceb8ec48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 43 additions and 33 deletions

View file

@ -61,7 +61,7 @@ from homeassistant.helpers.event import (
)
from homeassistant.helpers.reload import async_setup_reload_service
from homeassistant.helpers.restore_state import RestoreEntity
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType, VolDictType
from . import DOMAIN, PLATFORMS
@ -96,6 +96,10 @@ CONF_PRESETS = {
)
}
PRESETS_SCHEMA: VolDictType = {
vol.Optional(v): vol.Coerce(float) for v in CONF_PRESETS.values()
}
PLATFORM_SCHEMA_COMMON = vol.Schema(
{
vol.Required(CONF_HEATER): cv.entity_id,
@ -120,7 +124,7 @@ PLATFORM_SCHEMA_COMMON = vol.Schema(
vol.In([PRECISION_TENTHS, PRECISION_HALVES, PRECISION_WHOLE])
),
vol.Optional(CONF_UNIQUE_ID): cv.string,
**{vol.Optional(v): vol.Coerce(float) for v in CONF_PRESETS.values()},
**PRESETS_SCHEMA,
}
)