1
mirror of https://github.com/home-assistant/core synced 2024-09-06 10:29:55 +02:00

Enable basic type checking for gogogate2 (#52467)

* Enable basic type checking for gogogate2

* Tweak

* Update homeassistant/components/gogogate2/common.py

Co-authored-by: Ruslan Sayfutdinov <ruslan@sayfutdinov.com>

* Tweak

Co-authored-by: Ruslan Sayfutdinov <ruslan@sayfutdinov.com>
This commit is contained in:
Erik Montnemery 2021-07-03 17:06:42 +02:00 committed by GitHub
parent 44b44b5bd6
commit b3b377ac8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 9 deletions

View File

@ -18,13 +18,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
# Update the config entry.
config_updates = {}
if CONF_DEVICE not in entry.data:
config_updates["data"] = {
config_updates = {
**entry.data,
**{CONF_DEVICE: DEVICE_TYPE_GOGOGATE2},
}
if config_updates:
hass.config_entries.async_update_entry(entry, **config_updates)
hass.config_entries.async_update_entry(entry, data=config_updates)
data_update_coordinator = get_data_update_coordinator(hass, entry)
await data_update_coordinator.async_config_entry_first_refresh()

View File

@ -1,10 +1,10 @@
"""Common code for GogoGate2 component."""
from __future__ import annotations
from collections.abc import Awaitable
from collections.abc import Awaitable, Mapping
from datetime import timedelta
import logging
from typing import Callable, NamedTuple
from typing import Any, Callable, NamedTuple
from ismartgate import AbstractGateApi, GogoGate2Api, ISmartGateApi
from ismartgate.common import AbstractDoor, get_door_by_id
@ -149,7 +149,7 @@ def sensor_unique_id(
return f"{config_entry.unique_id}_{door.door_id}_{sensor_type}"
def get_api(hass: HomeAssistant, config_data: dict) -> AbstractGateApi:
def get_api(hass: HomeAssistant, config_data: Mapping[str, Any]) -> AbstractGateApi:
"""Get an api object for config data."""
gate_class = GogoGate2Api

View File

@ -1154,9 +1154,6 @@ ignore_errors = true
[mypy-homeassistant.components.glances.*]
ignore_errors = true
[mypy-homeassistant.components.gogogate2.*]
ignore_errors = true
[mypy-homeassistant.components.google_assistant.*]
ignore_errors = true

View File

@ -65,7 +65,6 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.garmin_connect.*",
"homeassistant.components.geniushub.*",
"homeassistant.components.glances.*",
"homeassistant.components.gogogate2.*",
"homeassistant.components.google_assistant.*",
"homeassistant.components.google_maps.*",
"homeassistant.components.google_pubsub.*",