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

@ -20,7 +20,7 @@ SERVICE_START_IRRIGATION = "start_irrigation"
SERVICE_SCHEMA_IRRIGATION = vol.Schema(
{
vol.Required(ATTR_ENTITY_ID): cv.entity_id,
vol.Required(ATTR_DURATION): vol.All(vol.Coerce(float), vol.Range(min=0)),
vol.Required(ATTR_DURATION): cv.positive_float,
}
)