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
def _get_registry_entries(
hass: HomeAssistant, entity_id: str
) -> tuple[device_registry.DeviceEntry, area_registry.AreaEntry]:
) -> tuple[device_registry.DeviceEntry | None, area_registry.AreaEntry | None]:
"""Get registry entries."""
ent_reg = entity_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(
hass: HomeAssistant, jwt_signed: str
) -> dict[str, Any] | list[str, Any] | Any:
) -> dict[str, Any] | list[Any] | Any:
headers = {
"Authorization": f"Bearer {jwt_signed}",
"Content-Type": "application/x-www-form-urlencoded",

View file

@ -3,6 +3,7 @@ from __future__ import annotations
from collections import deque
import logging
from typing import Any
from homeassistant.const import MATCH_ALL
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."""
checker = None
unsub_pending: CALLBACK_TYPE | None = None
pending = deque([{}])
pending: deque[dict[str, Any]] = deque([{}])
async def report_states(now=None):
"""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 None:
return None
try:
index = items.index(selected)
except ValueError:
@ -188,7 +190,7 @@ def _next_selected(items: list[str], selected: str | None) -> str | None:
class _Trait:
"""Represents a Trait inside Google Assistant skill."""
commands = []
commands: list[str] = []
@staticmethod
def might_2fa(domain, features, device_class):
@ -1701,7 +1703,7 @@ class InputSelectorTrait(_Trait):
name = TRAIT_INPUTSELECTOR
commands = [COMMAND_INPUT, COMMAND_NEXT_INPUT, COMMAND_PREVIOUS_INPUT]
SYNONYMS = {}
SYNONYMS: dict[str, list[str]] = {}
@staticmethod
def supported(domain, features, device_class, _):
@ -2197,7 +2199,7 @@ class MediaStateTrait(_Trait):
"""
name = TRAIT_MEDIA_STATE
commands = []
commands: list[str] = []
activity_lookup = {
STATE_OFF: "INACTIVE",
@ -2314,7 +2316,7 @@ class SensorStateTrait(_Trait):
}
name = TRAIT_SENSOR_STATE
commands = []
commands: list[str] = []
@classmethod
def supported(cls, domain, features, device_class, _):

View file

@ -2662,18 +2662,6 @@ ignore_errors = true
[mypy-homeassistant.components.evohome.water_heater]
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]
ignore_errors = true

View file

@ -29,10 +29,6 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.evohome",
"homeassistant.components.evohome.climate",
"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.auth",
"homeassistant.components.hassio.binary_sensor",