Add config validator helper positive_float (#41640)
This commit is contained in:
parent
874e1f6103
commit
93a9a11065
19 changed files with 26 additions and 43 deletions
|
@ -34,7 +34,7 @@ SCHEMA_STEP_STATION = vol.Schema({vol.Required(CONF_STATION): str})
|
|||
SCHEMA_STEP_OPTIONS = vol.Schema(
|
||||
{
|
||||
vol.Required(CONF_FILTER): vol.In([]),
|
||||
vol.Required(CONF_OFFSET, default=0): vol.All(int, vol.Range(min=0)),
|
||||
vol.Required(CONF_OFFSET, default=0): cv.positive_int,
|
||||
vol.Optional(CONF_REAL_TIME, default=True): bool,
|
||||
}
|
||||
)
|
||||
|
@ -207,7 +207,7 @@ class OptionsFlowHandler(config_entries.OptionsFlow):
|
|||
vol.Required(
|
||||
CONF_OFFSET,
|
||||
default=self.config_entry.options.get(CONF_OFFSET, 0),
|
||||
): vol.All(int, vol.Range(min=0)),
|
||||
): cv.positive_int,
|
||||
vol.Optional(
|
||||
CONF_REAL_TIME,
|
||||
default=self.config_entry.options.get(CONF_REAL_TIME, True),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue