Remove omnilogic from mypy ignore list (#74452)

pull/74850/head
epenet 2022-07-09 23:11:55 +02:00 committed by GitHub
parent da133a7f05
commit 3922141f5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 17 deletions

View File

@ -2,6 +2,7 @@
from datetime import timedelta from datetime import timedelta
import logging import logging
from typing import Any
from omnilogic import OmniLogic, OmniLogicException from omnilogic import OmniLogic, OmniLogicException
@ -122,7 +123,7 @@ class OmniLogicEntity(CoordinatorEntity[OmniLogicUpdateCoordinator]):
self._unique_id = unique_id self._unique_id = unique_id
self._item_id = item_id self._item_id = item_id
self._icon = icon self._icon = icon
self._attrs = {} self._attrs: dict[str, Any] = {}
self._msp_system_id = msp_system_id self._msp_system_id = msp_system_id
self._backyard_name = coordinator.data[backyard_id]["BackyardName"] self._backyard_name = coordinator.data[backyard_id]["BackyardName"]

View File

@ -1,4 +1,6 @@
"""Definition and setup of the Omnilogic Sensors for Home Assistant.""" """Definition and setup of the Omnilogic Sensors for Home Assistant."""
from typing import Any
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ( from homeassistant.const import (
@ -34,7 +36,8 @@ async def async_setup_entry(
continue continue
for entity_setting in entity_settings: for entity_setting in entity_settings:
for state_key, entity_class in entity_setting["entity_classes"].items(): entity_classes: dict[str, type] = entity_setting["entity_classes"]
for state_key, entity_class in entity_classes.items():
if check_guard(state_key, item, entity_setting): if check_guard(state_key, item, entity_setting):
continue continue
@ -248,7 +251,7 @@ class OmniLogicORPSensor(OmnilogicSensor):
return orp_state return orp_state
SENSOR_TYPES = { SENSOR_TYPES: dict[tuple[int, str], list[dict[str, Any]]] = {
(2, "Backyard"): [ (2, "Backyard"): [
{ {
"entity_classes": {"airTemp": OmniLogicTemperatureSensor}, "entity_classes": {"airTemp": OmniLogicTemperatureSensor},

View File

@ -1,5 +1,6 @@
"""Platform for Omnilogic switch integration.""" """Platform for Omnilogic switch integration."""
import time import time
from typing import Any
from omnilogic import OmniLogicException from omnilogic import OmniLogicException
import voluptuous as vol import voluptuous as vol
@ -34,7 +35,8 @@ async def async_setup_entry(
continue continue
for entity_setting in entity_settings: for entity_setting in entity_settings:
for state_key, entity_class in entity_setting["entity_classes"].items(): entity_classes: dict[str, type] = entity_setting["entity_classes"]
for state_key, entity_class in entity_classes.items():
if check_guard(state_key, item, entity_setting): if check_guard(state_key, item, entity_setting):
continue continue
@ -229,7 +231,7 @@ class OmniLogicPumpControl(OmniLogicSwitch):
raise OmniLogicException("Cannot set speed on a non-variable speed pump.") raise OmniLogicException("Cannot set speed on a non-variable speed pump.")
SWITCH_TYPES = { SWITCH_TYPES: dict[tuple[int, str], list[dict[str, Any]]] = {
(4, "Relays"): [ (4, "Relays"): [
{ {
"entity_classes": {"switchState": OmniLogicRelayControl}, "entity_classes": {"switchState": OmniLogicRelayControl},

View File

@ -2741,15 +2741,6 @@ ignore_errors = true
[mypy-homeassistant.components.nzbget.switch] [mypy-homeassistant.components.nzbget.switch]
ignore_errors = true ignore_errors = true
[mypy-homeassistant.components.omnilogic.common]
ignore_errors = true
[mypy-homeassistant.components.omnilogic.sensor]
ignore_errors = true
[mypy-homeassistant.components.omnilogic.switch]
ignore_errors = true
[mypy-homeassistant.components.onvif.base] [mypy-homeassistant.components.onvif.base]
ignore_errors = true ignore_errors = true

View File

@ -48,9 +48,6 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.nzbget.config_flow", "homeassistant.components.nzbget.config_flow",
"homeassistant.components.nzbget.coordinator", "homeassistant.components.nzbget.coordinator",
"homeassistant.components.nzbget.switch", "homeassistant.components.nzbget.switch",
"homeassistant.components.omnilogic.common",
"homeassistant.components.omnilogic.sensor",
"homeassistant.components.omnilogic.switch",
"homeassistant.components.onvif.base", "homeassistant.components.onvif.base",
"homeassistant.components.onvif.binary_sensor", "homeassistant.components.onvif.binary_sensor",
"homeassistant.components.onvif.camera", "homeassistant.components.onvif.camera",