diff --git a/homeassistant/components/frontend/www_static/polymer/home-assistant-js b/homeassistant/components/frontend/www_static/polymer/home-assistant-js index 14f2bb779eb..015edf9c28a 160000 --- a/homeassistant/components/frontend/www_static/polymer/home-assistant-js +++ b/homeassistant/components/frontend/www_static/polymer/home-assistant-js @@ -1 +1 @@ -Subproject commit 14f2bb779eb165bce236dcdc69d83e08ab73da1c +Subproject commit 015edf9c28a63122aa8f6bc153f0c0ddfaad1caa diff --git a/homeassistant/components/media_player/cast.py b/homeassistant/components/media_player/cast.py index 77cdf79a112..4e33034d821 100644 --- a/homeassistant/components/media_player/cast.py +++ b/homeassistant/components/media_player/cast.py @@ -25,10 +25,12 @@ from homeassistant.components.media_player import ( SUPPORT_PREVIOUS_TRACK, SUPPORT_NEXT_TRACK, MEDIA_TYPE_MUSIC, MEDIA_TYPE_TVSHOW, MEDIA_TYPE_VIDEO) +CONF_IGNORE_CEC = 'ignore_cec' CAST_SPLASH = 'https://home-assistant.io/images/cast/splash.png' SUPPORT_CAST = SUPPORT_PAUSE | SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE | \ SUPPORT_TURN_ON | SUPPORT_TURN_OFF | SUPPORT_PREVIOUS_TRACK | \ SUPPORT_NEXT_TRACK | SUPPORT_YOUTUBE +KNOWN_HOSTS = [] # pylint: disable=unused-argument @@ -43,12 +45,22 @@ def setup_platform(hass, config, add_devices, discovery_info=None): return False - if discovery_info: + # import CEC IGNORE attributes + ignore_cec = config.get(CONF_IGNORE_CEC, []) + if isinstance(ignore_cec, list): + pychromecast.IGNORE_CEC += ignore_cec + else: + logger.error('Chromecast conig, %s must be a list.', CONF_IGNORE_CEC) + + hosts = [] + + if discovery_info and discovery_info[0] not in KNOWN_HOSTS: hosts = [discovery_info[0]] else: hosts = (host_port[0] for host_port - in pychromecast.discover_chromecasts()) + in pychromecast.discover_chromecasts() + if host_port[0] not in KNOWN_HOSTS) casts = [] @@ -57,6 +69,8 @@ def setup_platform(hass, config, add_devices, discovery_info=None): casts.append(CastDevice(host)) except pychromecast.ChromecastConnectionError: pass + else: + KNOWN_HOSTS.append(host) add_devices(casts) diff --git a/requirements.txt b/requirements.txt index 9f7e788f47c..67e9f1c5249 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,7 +18,7 @@ phue>=0.8 ledcontroller>=1.0.7 # Chromecast bindings (media_player.cast) -pychromecast>=0.6.6 +pychromecast>=0.6.7 # Keyboard (keyboard) pyuserinput>=0.1.9