1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-23 20:39:01 +00:00

Add config validator helper positive_float (#41640)

This commit is contained in:
Matthias Alphart
2020-10-11 22:04:49 +02:00
committed by GitHub
parent 874e1f6103
commit 93a9a11065
19 changed files with 26 additions and 43 deletions

View File

@@ -64,9 +64,7 @@ PLATFORM_SCHEMA = vol.Schema(
vol.Optional(CONF_SCOPE, default=DEFAULT_SCOPE): vol.In(
SCOPE_TYPES
),
vol.Optional(CONF_DEVICE): vol.All(
vol.Coerce(int), vol.Range(min=0)
),
vol.Optional(CONF_DEVICE): cv.positive_int,
}
],
),