This commit is contained in:
Paulus Schoutsen committed 2019-07-31 12:25:30 -07:00
1 parent da05dfe708
commit 4de97abc3a
2676 files changed
+163166 -140084

No files matched your search

@@ -6,16 +6,19 @@ import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.device_tracker import (
DOMAIN, PLATFORM_SCHEMA, DeviceScanner)
DOMAIN,
PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.const import CONF_HOST
_LOGGER = logging.getLogger(__name__)
DEFAULT_HOST = '10.0.0.1'
DEFAULT_HOST = "10.0.0.1"
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_HOST, default=DEFAULT_HOST): cv.string
})
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
{vol.Optional(CONF_HOST, default=DEFAULT_HOST): cv.string}
)
def get_scanner(hass, config):
@@ -28,8 +31,9 @@ def get_scanner(hass, config):
gateway.scan_devices()
scanner = XfinityDeviceScanner(gateway)
except (RequestException, ValueError):
_LOGGER.error("Error communicating with Xfinity Gateway. "
"Check host: %s", gateway.host)
_LOGGER.error(
"Error communicating with Xfinity Gateway. " "Check host: %s", gateway.host
)
return scanner
@@ -47,8 +51,7 @@ class XfinityDeviceScanner(DeviceScanner):
try:
connected_devices = self.gateway.scan_devices()
except (RequestException, ValueError):
_LOGGER.error("Unable to scan devices. "
"Check connection to gateway")
_LOGGER.error("Unable to scan devices. " "Check connection to gateway")
return connected_devices
def get_device_name(self, device):