diff --git a/homeassistant/components/asuswrt/bridge.py b/homeassistant/components/asuswrt/bridge.py index 48653b1890f..81ace7d2873 100644 --- a/homeassistant/components/asuswrt/bridge.py +++ b/homeassistant/components/asuswrt/bridge.py @@ -125,7 +125,9 @@ class AsusWrtBridge(ABC): @staticmethod def get_bridge( - hass: HomeAssistant, conf: dict[str, Any], options: dict[str, Any] | None = None + hass: HomeAssistant, + conf: dict[str, str | int], + options: dict[str, str | bool | int] | None = None, ) -> AsusWrtBridge: """Get Bridge instance.""" if conf[CONF_PROTOCOL] in (PROTOCOL_HTTPS, PROTOCOL_HTTP): diff --git a/homeassistant/components/asuswrt/config_flow.py b/homeassistant/components/asuswrt/config_flow.py index a86f7e08318..4dbbd34bfdc 100644 --- a/homeassistant/components/asuswrt/config_flow.py +++ b/homeassistant/components/asuswrt/config_flow.py @@ -175,12 +175,12 @@ class AsusWrtFlowHandler(ConfigFlow, domain=DOMAIN): ) async def _async_check_connection( - self, user_input: dict[str, Any] + self, user_input: dict[str, str | int] ) -> tuple[str, str | None]: """Attempt to connect the AsusWrt router.""" api: AsusWrtBridge - host: str = user_input[CONF_HOST] + host = user_input[CONF_HOST] protocol = user_input[CONF_PROTOCOL] error: str | None = None diff --git a/homeassistant/components/asuswrt/router.py b/homeassistant/components/asuswrt/router.py index 3631c7a25bb..cf8995c6f63 100644 --- a/homeassistant/components/asuswrt/router.py +++ b/homeassistant/components/asuswrt/router.py @@ -176,7 +176,7 @@ class AsusWrtRouter: self._on_close: list[Callable] = [] - self._options: dict[str, Any] = { + self._options: dict[str, str | bool | int] = { CONF_DNSMASQ: DEFAULT_DNSMASQ, CONF_INTERFACE: DEFAULT_INTERFACE, CONF_REQUIRE_IP: True, @@ -299,12 +299,10 @@ class AsusWrtRouter: _LOGGER.warning("Reconnected to ASUS router %s", self.host) self._connected_devices = len(wrt_devices) - consider_home: int = self._options.get( - CONF_CONSIDER_HOME, DEFAULT_CONSIDER_HOME.total_seconds() - ) - track_unknown: bool = self._options.get( - CONF_TRACK_UNKNOWN, DEFAULT_TRACK_UNKNOWN + consider_home = int( + self._options.get(CONF_CONSIDER_HOME, DEFAULT_CONSIDER_HOME.total_seconds()) ) + track_unknown = self._options.get(CONF_TRACK_UNKNOWN, DEFAULT_TRACK_UNKNOWN) for device_mac, device in self._devices.items(): dev_info = wrt_devices.pop(device_mac, None)