mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 17:57:55 +00: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:
parent
44b44b5bd6
commit
b3b377ac8b
@ -18,13 +18,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
# Update the config entry.
|
# Update the config entry.
|
||||||
config_updates = {}
|
config_updates = {}
|
||||||
if CONF_DEVICE not in entry.data:
|
if CONF_DEVICE not in entry.data:
|
||||||
config_updates["data"] = {
|
config_updates = {
|
||||||
**entry.data,
|
**entry.data,
|
||||||
**{CONF_DEVICE: DEVICE_TYPE_GOGOGATE2},
|
**{CONF_DEVICE: DEVICE_TYPE_GOGOGATE2},
|
||||||
}
|
}
|
||||||
|
|
||||||
if config_updates:
|
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)
|
data_update_coordinator = get_data_update_coordinator(hass, entry)
|
||||||
await data_update_coordinator.async_config_entry_first_refresh()
|
await data_update_coordinator.async_config_entry_first_refresh()
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
"""Common code for GogoGate2 component."""
|
"""Common code for GogoGate2 component."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable, Mapping
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import Callable, NamedTuple
|
from typing import Any, Callable, NamedTuple
|
||||||
|
|
||||||
from ismartgate import AbstractGateApi, GogoGate2Api, ISmartGateApi
|
from ismartgate import AbstractGateApi, GogoGate2Api, ISmartGateApi
|
||||||
from ismartgate.common import AbstractDoor, get_door_by_id
|
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}"
|
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."""
|
"""Get an api object for config data."""
|
||||||
gate_class = GogoGate2Api
|
gate_class = GogoGate2Api
|
||||||
|
|
||||||
|
3
mypy.ini
3
mypy.ini
@ -1154,9 +1154,6 @@ ignore_errors = true
|
|||||||
[mypy-homeassistant.components.glances.*]
|
[mypy-homeassistant.components.glances.*]
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
|
|
||||||
[mypy-homeassistant.components.gogogate2.*]
|
|
||||||
ignore_errors = true
|
|
||||||
|
|
||||||
[mypy-homeassistant.components.google_assistant.*]
|
[mypy-homeassistant.components.google_assistant.*]
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
|
|
||||||
|
@ -65,7 +65,6 @@ IGNORED_MODULES: Final[list[str]] = [
|
|||||||
"homeassistant.components.garmin_connect.*",
|
"homeassistant.components.garmin_connect.*",
|
||||||
"homeassistant.components.geniushub.*",
|
"homeassistant.components.geniushub.*",
|
||||||
"homeassistant.components.glances.*",
|
"homeassistant.components.glances.*",
|
||||||
"homeassistant.components.gogogate2.*",
|
|
||||||
"homeassistant.components.google_assistant.*",
|
"homeassistant.components.google_assistant.*",
|
||||||
"homeassistant.components.google_maps.*",
|
"homeassistant.components.google_maps.*",
|
||||||
"homeassistant.components.google_pubsub.*",
|
"homeassistant.components.google_pubsub.*",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user