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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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,
}
],
),