diff --git a/homeassistant/components/doorbird/__init__.py b/homeassistant/components/doorbird/__init__.py index 0bd34d1a724..6fc176d4507 100644 --- a/homeassistant/components/doorbird/__init__.py +++ b/homeassistant/components/doorbird/__init__.py @@ -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. diff --git a/homeassistant/components/doorbird/button.py b/homeassistant/components/doorbird/button.py index b823c81c6d0..6e162599e36 100644 --- a/homeassistant/components/doorbird/button.py +++ b/homeassistant/components/doorbird/button.py @@ -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, diff --git a/homeassistant/components/enphase_envoy/sensor.py b/homeassistant/components/enphase_envoy/sensor.py index ba19f0a3f53..03431ddc3ea 100644 --- a/homeassistant/components/enphase_envoy/sensor.py +++ b/homeassistant/components/enphase_envoy/sensor.py @@ -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 diff --git a/homeassistant/components/flo/binary_sensor.py b/homeassistant/components/flo/binary_sensor.py index 44e1fd676ea..c395e6136fe 100644 --- a/homeassistant/components/flo/binary_sensor.py +++ b/homeassistant/components/flo/binary_sensor.py @@ -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. diff --git a/homeassistant/components/flo/device.py b/homeassistant/components/flo/device.py index cc32acb485c..ca4b6aa6234 100644 --- a/homeassistant/components/flo/device.py +++ b/homeassistant/components/flo/device.py @@ -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, diff --git a/homeassistant/components/fortios/device_tracker.py b/homeassistant/components/fortios/device_tracker.py index 0e2d45db537..d6992d8c045 100644 --- a/homeassistant/components/fortios/device_tracker.py +++ b/homeassistant/components/fortios/device_tracker.py @@ -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): diff --git a/homeassistant/components/foscam/__init__.py b/homeassistant/components/foscam/__init__.py index da2d61ef369..2adac19c1de 100644 --- a/homeassistant/components/foscam/__init__.py +++ b/homeassistant/components/foscam/__init__.py @@ -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 diff --git a/mypy.ini b/mypy.ini index 77e47ffdb5c..9f76bfa9739 100644 --- a/mypy.ini +++ b/mypy.ini @@ -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 diff --git a/script/hassfest/mypy_config.py b/script/hassfest/mypy_config.py index b41703d4065..bf1d008a059 100644 --- a/script/hassfest/mypy_config.py +++ b/script/hassfest/mypy_config.py @@ -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.*",