mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Add automation config validation
* Add automation config validation * Remove unnecessary dict validator * Downgrade voluptuous to 0.8.9 * Fix linting * Address issues
This commit is contained in:
@@ -77,9 +77,9 @@ _DELAY_SCHEMA = {
|
||||
'minutes': vol.All(vol.Coerce(int), vol.Range(min=0)),
|
||||
'hours': vol.All(vol.Coerce(int), vol.Range(min=0)),
|
||||
'weeks': vol.All(vol.Coerce(int), vol.Range(min=0)),
|
||||
}, cv.has_at_least_one_key([
|
||||
}, cv.has_at_least_one_key(
|
||||
'days', 'seconds', 'microseconds', 'milliseconds', 'minutes', 'hours',
|
||||
'weeks']))
|
||||
'weeks'))
|
||||
}
|
||||
|
||||
_EVENT_SCHEMA = cv.EVENT_SCHEMA.extend({
|
||||
@@ -97,7 +97,7 @@ _SCRIPT_ENTRY_SCHEMA = vol.Schema({
|
||||
})
|
||||
|
||||
CONFIG_SCHEMA = vol.Schema({
|
||||
vol.Required(DOMAIN): cv.DictValidator(_SCRIPT_ENTRY_SCHEMA, cv.slug)
|
||||
vol.Required(DOMAIN): {cv.slug: _SCRIPT_ENTRY_SCHEMA}
|
||||
}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user