Bugfix async blocking loop with xml parser. (#5694)

This commit is contained in:
Pascal Vizeli 2017-02-01 17:20:52 +01:00 committed by GitHub
parent 32f8622bba
commit a72d32b9af

View file

@ -92,7 +92,8 @@ class UPCDeviceScanner(DeviceScanner):
raw = yield from self._async_ws_function(CMD_DEVICES)
try:
xml_root = ET.fromstring(raw)
xml_root = yield from self.hass.loop.run_in_executor(
None, ET.fromstring, raw)
return [mac.text for mac in xml_root.iter('MACAddr')]
except (ET.ParseError, TypeError):
_LOGGER.warning("Can't read device from %s", self.host)