mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Use voluptuous for cast ignore-cec (#5468)
This commit is contained in:
parent
a7e5c847fb
commit
5ff9dfa440
@ -37,6 +37,7 @@ KNOWN_HOSTS = []
|
|||||||
|
|
||||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||||
vol.Optional(CONF_HOST): cv.string,
|
vol.Optional(CONF_HOST): cv.string,
|
||||||
|
vol.Optional(CONF_IGNORE_CEC): [cv.string],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -46,11 +47,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
import pychromecast
|
import pychromecast
|
||||||
|
|
||||||
# import CEC IGNORE attributes
|
# import CEC IGNORE attributes
|
||||||
ignore_cec = config.get(CONF_IGNORE_CEC, [])
|
pychromecast.IGNORE_CEC += config.get(CONF_IGNORE_CEC, [])
|
||||||
if isinstance(ignore_cec, list):
|
|
||||||
pychromecast.IGNORE_CEC += ignore_cec
|
|
||||||
else:
|
|
||||||
_LOGGER.error('CEC config "%s" must be a list.', CONF_IGNORE_CEC)
|
|
||||||
|
|
||||||
hosts = []
|
hosts = []
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user