Remove integrations from mypy ignored modules (#64358)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2022-01-18 13:26:12 +01:00 committed by GitHub
parent d1a2ce4b78
commit 45313e3f7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 17 additions and 30 deletions

View File

@ -1,4 +1,6 @@
"""Support for DoorBird devices."""
from __future__ import annotations
from http import HTTPStatus
import logging
@ -285,7 +287,7 @@ class ConfiguredDoorBird:
"""Return whether the given URL is registered as a device favorite."""
return self.get_webhook_id(url, favs) is not None
def get_webhook_id(self, url, favs=None) -> str or None:
def get_webhook_id(self, url, favs=None) -> str | None:
"""
Return the device favorite ID for the given URL.

View File

@ -70,6 +70,8 @@ async def async_setup_entry(
class DoorBirdButton(DoorBirdEntity, ButtonEntity):
"""A relay in a DoorBird device."""
entity_description: DoorbirdButtonEntityDescription
def __init__(
self,
doorstation: DoorBird,

View File

@ -135,7 +135,7 @@ class Envoy(CoordinatorEntity, SensorEntity):
return None
@property
def device_info(self) -> DeviceInfo:
def device_info(self) -> DeviceInfo | None:
"""Return the device_info of the device."""
if not self._device_serial_number:
return None

View File

@ -23,7 +23,7 @@ async def async_setup_entry(
devices: list[FloDeviceDataUpdateCoordinator] = hass.data[FLO_DOMAIN][
config_entry.entry_id
]["devices"]
entities = []
entities: list[BinarySensorEntity] = []
for device in devices:
if device.device_type == "puck_oem":
# Flo "pucks" (leak detectors) *do* support pending alerts.

View File

@ -28,8 +28,8 @@ class FloDeviceDataUpdateCoordinator(DataUpdateCoordinator):
self._flo_location_id: str = location_id
self._flo_device_id: str = device_id
self._manufacturer: str = "Flo by Moen"
self._device_information: dict[str, Any] | None = None
self._water_usage: dict[str, Any] | None = None
self._device_information: dict[str, Any] = {}
self._water_usage: dict[str, Any] = {}
super().__init__(
hass,
LOGGER,

View File

@ -6,6 +6,7 @@ This component is part of the device_tracker platform.
from __future__ import annotations
import logging
from typing import Any
from awesomeversion import AwesomeVersion
from fortiosapi import FortiOSAPI
@ -13,7 +14,7 @@ import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA,
PLATFORM_SCHEMA as BASE_PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.const import CONF_HOST, CONF_TOKEN, CONF_VERIFY_SSL
@ -25,7 +26,7 @@ _LOGGER = logging.getLogger(__name__)
DEFAULT_VERIFY_SSL = False
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
PLATFORM_SCHEMA = BASE_PLATFORM_SCHEMA.extend(
{
vol.Required(CONF_HOST): cv.string,
vol.Required(CONF_TOKEN): cv.string,
@ -71,8 +72,8 @@ class FortiOSDeviceScanner(DeviceScanner):
def __init__(self, fgt) -> None:
"""Initialize the scanner."""
self._clients = {}
self._clients_json = {}
self._clients: list[str] = []
self._clients_json: dict[str, Any] = {}
self._fgt = fgt
def update(self):

View File

@ -71,7 +71,9 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
if ret != 0:
rtsp_port = response.get("rtspPort") or response.get("mediaPort")
entry.data = {**entry.data, CONF_RTSP_PORT: rtsp_port}
hass.config_entries.async_update_entry(
entry, data={**entry.data, CONF_RTSP_PORT: rtsp_port}
)
# Change entry version
entry.version = 2

View File

@ -2036,12 +2036,6 @@ ignore_errors = true
[mypy-homeassistant.components.dhcp.*]
ignore_errors = true
[mypy-homeassistant.components.doorbird.*]
ignore_errors = true
[mypy-homeassistant.components.enphase_envoy.*]
ignore_errors = true
[mypy-homeassistant.components.evohome.*]
ignore_errors = true
@ -2051,15 +2045,6 @@ ignore_errors = true
[mypy-homeassistant.components.firmata.*]
ignore_errors = true
[mypy-homeassistant.components.flo.*]
ignore_errors = true
[mypy-homeassistant.components.fortios.*]
ignore_errors = true
[mypy-homeassistant.components.foscam.*]
ignore_errors = true
[mypy-homeassistant.components.freebox.*]
ignore_errors = true

View File

@ -24,14 +24,9 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.demo.*",
"homeassistant.components.denonavr.*",
"homeassistant.components.dhcp.*",
"homeassistant.components.doorbird.*",
"homeassistant.components.enphase_envoy.*",
"homeassistant.components.evohome.*",
"homeassistant.components.fireservicerota.*",
"homeassistant.components.firmata.*",
"homeassistant.components.flo.*",
"homeassistant.components.fortios.*",
"homeassistant.components.foscam.*",
"homeassistant.components.freebox.*",
"homeassistant.components.geniushub.*",
"homeassistant.components.google_assistant.*",