Remove google_assistant from mypy ignore list (#74587)

This commit is contained in:
epenet 2022-07-07 11:35:45 +02:00 committed by GitHub
parent 4261595078
commit 5ae593672e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 23 deletions

View File

@ -51,7 +51,7 @@ LOCAL_SDK_MIN_VERSION = AwesomeVersion("2.1.5")
@callback @callback
def _get_registry_entries( def _get_registry_entries(
hass: HomeAssistant, entity_id: str hass: HomeAssistant, entity_id: str
) -> tuple[device_registry.DeviceEntry, area_registry.AreaEntry]: ) -> tuple[device_registry.DeviceEntry | None, area_registry.AreaEntry | None]:
"""Get registry entries.""" """Get registry entries."""
ent_reg = entity_registry.async_get(hass) ent_reg = entity_registry.async_get(hass)
dev_reg = device_registry.async_get(hass) dev_reg = device_registry.async_get(hass)

View File

@ -59,7 +59,7 @@ def _get_homegraph_jwt(time, iss, key):
async def _get_homegraph_token( async def _get_homegraph_token(
hass: HomeAssistant, jwt_signed: str hass: HomeAssistant, jwt_signed: str
) -> dict[str, Any] | list[str, Any] | Any: ) -> dict[str, Any] | list[Any] | Any:
headers = { headers = {
"Authorization": f"Bearer {jwt_signed}", "Authorization": f"Bearer {jwt_signed}",
"Content-Type": "application/x-www-form-urlencoded", "Content-Type": "application/x-www-form-urlencoded",

View File

@ -3,6 +3,7 @@ from __future__ import annotations
from collections import deque from collections import deque
import logging import logging
from typing import Any
from homeassistant.const import MATCH_ALL from homeassistant.const import MATCH_ALL
from homeassistant.core import CALLBACK_TYPE, HassJob, HomeAssistant, callback from homeassistant.core import CALLBACK_TYPE, HassJob, HomeAssistant, callback
@ -28,7 +29,7 @@ def async_enable_report_state(hass: HomeAssistant, google_config: AbstractConfig
"""Enable state reporting.""" """Enable state reporting."""
checker = None checker = None
unsub_pending: CALLBACK_TYPE | None = None unsub_pending: CALLBACK_TYPE | None = None
pending = deque([{}]) pending: deque[dict[str, Any]] = deque([{}])
async def report_states(now=None): async def report_states(now=None):
"""Report the states.""" """Report the states."""

View File

@ -176,6 +176,8 @@ def _next_selected(items: list[str], selected: str | None) -> str | None:
If selected is missing in items, None is returned If selected is missing in items, None is returned
""" """
if selected is None:
return None
try: try:
index = items.index(selected) index = items.index(selected)
except ValueError: except ValueError:
@ -188,7 +190,7 @@ def _next_selected(items: list[str], selected: str | None) -> str | None:
class _Trait: class _Trait:
"""Represents a Trait inside Google Assistant skill.""" """Represents a Trait inside Google Assistant skill."""
commands = [] commands: list[str] = []
@staticmethod @staticmethod
def might_2fa(domain, features, device_class): def might_2fa(domain, features, device_class):
@ -1701,7 +1703,7 @@ class InputSelectorTrait(_Trait):
name = TRAIT_INPUTSELECTOR name = TRAIT_INPUTSELECTOR
commands = [COMMAND_INPUT, COMMAND_NEXT_INPUT, COMMAND_PREVIOUS_INPUT] commands = [COMMAND_INPUT, COMMAND_NEXT_INPUT, COMMAND_PREVIOUS_INPUT]
SYNONYMS = {} SYNONYMS: dict[str, list[str]] = {}
@staticmethod @staticmethod
def supported(domain, features, device_class, _): def supported(domain, features, device_class, _):
@ -2197,7 +2199,7 @@ class MediaStateTrait(_Trait):
""" """
name = TRAIT_MEDIA_STATE name = TRAIT_MEDIA_STATE
commands = [] commands: list[str] = []
activity_lookup = { activity_lookup = {
STATE_OFF: "INACTIVE", STATE_OFF: "INACTIVE",
@ -2314,7 +2316,7 @@ class SensorStateTrait(_Trait):
} }
name = TRAIT_SENSOR_STATE name = TRAIT_SENSOR_STATE
commands = [] commands: list[str] = []
@classmethod @classmethod
def supported(cls, domain, features, device_class, _): def supported(cls, domain, features, device_class, _):

View File

@ -2662,18 +2662,6 @@ ignore_errors = true
[mypy-homeassistant.components.evohome.water_heater] [mypy-homeassistant.components.evohome.water_heater]
ignore_errors = true ignore_errors = true
[mypy-homeassistant.components.google_assistant.helpers]
ignore_errors = true
[mypy-homeassistant.components.google_assistant.http]
ignore_errors = true
[mypy-homeassistant.components.google_assistant.report_state]
ignore_errors = true
[mypy-homeassistant.components.google_assistant.trait]
ignore_errors = true
[mypy-homeassistant.components.hassio] [mypy-homeassistant.components.hassio]
ignore_errors = true ignore_errors = true

View File

@ -29,10 +29,6 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.evohome", "homeassistant.components.evohome",
"homeassistant.components.evohome.climate", "homeassistant.components.evohome.climate",
"homeassistant.components.evohome.water_heater", "homeassistant.components.evohome.water_heater",
"homeassistant.components.google_assistant.helpers",
"homeassistant.components.google_assistant.http",
"homeassistant.components.google_assistant.report_state",
"homeassistant.components.google_assistant.trait",
"homeassistant.components.hassio", "homeassistant.components.hassio",
"homeassistant.components.hassio.auth", "homeassistant.components.hassio.auth",
"homeassistant.components.hassio.binary_sensor", "homeassistant.components.hassio.binary_sensor",