Use vol.Coerce for notify SourceType enum (#77930)
parent
501b8b341f
commit
0b97dcf0bd
|
@ -71,12 +71,7 @@ from .const import (
|
|||
|
||||
SERVICE_SEE: Final = "see"
|
||||
|
||||
SOURCE_TYPES: Final[tuple[str, ...]] = (
|
||||
SourceType.GPS,
|
||||
SourceType.ROUTER,
|
||||
SourceType.BLUETOOTH,
|
||||
SourceType.BLUETOOTH_LE,
|
||||
)
|
||||
SOURCE_TYPES = [cls.value for cls in SourceType]
|
||||
|
||||
NEW_DEVICE_DEFAULTS_SCHEMA = vol.Any(
|
||||
None,
|
||||
|
@ -108,7 +103,7 @@ SERVICE_SEE_PAYLOAD_SCHEMA: Final[vol.Schema] = vol.Schema(
|
|||
ATTR_GPS_ACCURACY: cv.positive_int,
|
||||
ATTR_BATTERY: cv.positive_int,
|
||||
ATTR_ATTRIBUTES: dict,
|
||||
ATTR_SOURCE_TYPE: vol.In(SOURCE_TYPES),
|
||||
ATTR_SOURCE_TYPE: vol.Coerce(SourceType),
|
||||
ATTR_CONSIDER_HOME: cv.time_period,
|
||||
# Temp workaround for iOS app introduced in 0.65
|
||||
vol.Optional("battery_status"): str,
|
||||
|
|
Loading…
Reference in New Issue