Fix broken EnOcean support (#4710)
* ensure_list * CONF_ID is not required configuration for enocean lights * Use vol.All(cv.ensure_list, [vol.Coerce(int)]) as suggested in pull request review * Fix line too longpull/4751/merge
parent
71fc446425
commit
e21382cd3e
|
@ -20,7 +20,7 @@ DEPENDENCIES = ['enocean']
|
|||
DEFAULT_NAME = 'EnOcean binary sensor'
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
vol.Required(CONF_ID): cv.string,
|
||||
vol.Required(CONF_ID): vol.All(cv.ensure_list, [vol.Coerce(int)]),
|
||||
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
|
||||
vol.Optional(CONF_SENSOR_CLASS, default=None): SENSOR_CLASSES_SCHEMA,
|
||||
})
|
||||
|
|
|
@ -26,8 +26,9 @@ DEPENDENCIES = ['enocean']
|
|||
SUPPORT_ENOCEAN = SUPPORT_BRIGHTNESS
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
vol.Required(CONF_ID): cv.string,
|
||||
vol.Required(CONF_SENDER_ID): cv.string,
|
||||
vol.Optional(CONF_ID, default=[]): vol.All(cv.ensure_list,
|
||||
[vol.Coerce(int)]),
|
||||
vol.Required(CONF_SENDER_ID): vol.All(cv.ensure_list, [vol.Coerce(int)]),
|
||||
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
|
||||
})
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ DEFAULT_NAME = 'EnOcean sensor'
|
|||
DEPENDENCIES = ['enocean']
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
vol.Required(CONF_ID): cv.string,
|
||||
vol.Required(CONF_ID): vol.All(cv.ensure_list, [vol.Coerce(int)]),
|
||||
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
|
||||
})
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ DEFAULT_NAME = 'EnOcean Switch'
|
|||
DEPENDENCIES = ['enocean']
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
vol.Required(CONF_ID): cv.string,
|
||||
vol.Required(CONF_ID): vol.All(cv.ensure_list, [vol.Coerce(int)]),
|
||||
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue