Fix cast doing I/O in event loop (#12632)

This commit is contained in:
Otto Winter 2018-02-24 00:13:48 +01:00 committed by Paulus Schoutsen
parent 7a44eee093
commit c076b805e7

View File

@ -182,7 +182,8 @@ def async_setup_platform(hass: HomeAssistantType, config: ConfigType,
else:
# Manually add a "normal" Chromecast, we can do that without discovery.
try:
chromecast = pychromecast.Chromecast(*want_host)
chromecast = yield from hass.async_add_job(
pychromecast.Chromecast, *want_host)
except pychromecast.ChromecastConnectionError:
_LOGGER.warning("Can't set up chromecast on %s", want_host[0])
raise