Try to register a Chromecast anyway, even if it could not be detected by get_chromecasts(), since it might be on a other network. Fixes #4469. (#4470)

This commit is contained in:
Michaël Arnauts 2016-11-23 07:16:01 +01:00 committed by Paulus Schoutsen
parent 0c47434aad
commit 0c6ef3b7f9

View File

@ -81,6 +81,13 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
KNOWN_HOSTS.append(host) KNOWN_HOSTS.append(host)
except pychromecast.ChromecastConnectionError: except pychromecast.ChromecastConnectionError:
pass pass
else:
try:
# add the device anyway, get_chromecasts couldn't find it
casts.append(CastDevice(pychromecast.Chromecast(*host)))
KNOWN_HOSTS.append(host)
except pychromecast.ChromecastConnectionError:
pass
add_devices(casts) add_devices(casts)