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

pull/5707/head
Pascal Vizeli 2017-02-01 17:20:52 +01:00 committed by Paulus Schoutsen
parent bc7fd5611e
commit 6ee7878236
1 changed files with 2 additions and 1 deletions

View File

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