1 """Support for Verizon FiOS Quantum Gateways."""
3 from __future__
import annotations
7 from quantum_gateway
import QuantumGatewayScanner
8 from requests.exceptions
import RequestException
9 import voluptuous
as vol
12 DOMAIN
as DEVICE_TRACKER_DOMAIN,
13 PLATFORM_SCHEMA
as DEVICE_TRACKER_PLATFORM_SCHEMA,
21 _LOGGER = logging.getLogger(__name__)
23 DEFAULT_HOST =
"myfiosgateway.com"
25 PLATFORM_SCHEMA = DEVICE_TRACKER_PLATFORM_SCHEMA.extend(
27 vol.Optional(CONF_HOST, default=DEFAULT_HOST): cv.string,
28 vol.Optional(CONF_SSL, default=
True): cv.boolean,
29 vol.Required(CONF_PASSWORD): cv.string,
35 hass: HomeAssistant, config: ConfigType
36 ) -> QuantumGatewayDeviceScanner |
None:
37 """Validate the configuration and return a Quantum Gateway scanner."""
40 return scanner
if scanner.success_init
else None
44 """Class which queries a Quantum Gateway."""
47 """Initialize the scanner."""
49 self.
hosthost = config[CONF_HOST]
52 _LOGGER.debug(
"Initializing")
55 self.
quantumquantum = QuantumGatewayScanner(
59 except RequestException:
61 _LOGGER.error(
"Unable to connect to gateway. Check host")
64 _LOGGER.error(
"Unable to login to gateway. Check password and host")
67 """Scan for new devices and return a list of found MACs."""
68 connected_devices = []
71 except RequestException:
72 _LOGGER.error(
"Unable to scan devices. Check connection to router")
73 return connected_devices
76 """Return the name of the given device or None if we don't know."""
def get_device_name(self, device)
def __init__(self, config)
QuantumGatewayDeviceScanner|None get_scanner(HomeAssistant hass, ConfigType config)