diff --git a/homeassistant/components/meteo_france/const.py b/homeassistant/components/meteo_france/const.py index df667b1964b..d6cbd34d88d 100644 --- a/homeassistant/components/meteo_france/const.py +++ b/homeassistant/components/meteo_france/const.py @@ -183,7 +183,7 @@ SENSOR_TYPES_PROBABILITY: tuple[MeteoFranceSensorEntityDescription, ...] = ( ) -CONDITION_CLASSES = { +CONDITION_CLASSES: dict[str, list[str]] = { ATTR_CONDITION_CLEAR_NIGHT: ["Nuit Claire", "Nuit claire"], ATTR_CONDITION_CLOUDY: ["Très nuageux", "Couvert"], ATTR_CONDITION_FOG: [ diff --git a/homeassistant/components/meteo_france/sensor.py b/homeassistant/components/meteo_france/sensor.py index 0d90e4d33be..823018f405f 100644 --- a/homeassistant/components/meteo_france/sensor.py +++ b/homeassistant/components/meteo_france/sensor.py @@ -1,4 +1,6 @@ """Support for Meteo-France raining forecast sensor.""" +from __future__ import annotations + from meteofrance_api.helpers import ( get_warning_text_status_from_indice_color, readeable_phenomenoms_dict, @@ -97,6 +99,11 @@ class MeteoFranceSensor(CoordinatorEntity, SensorEntity): @property def device_info(self) -> DeviceInfo: """Return the device info.""" + assert ( + self.platform + and self.platform.config_entry + and self.platform.config_entry.unique_id + ) return DeviceInfo( entry_type=DeviceEntryType.SERVICE, identifiers={(DOMAIN, self.platform.config_entry.unique_id)}, @@ -191,7 +198,7 @@ class MeteoFranceAlertSensor(MeteoFranceSensor): def _find_first_probability_forecast_not_null( probability_forecast: list, path: list -) -> int: +) -> int | None: """Search the first not None value in the first forecast elements.""" for forecast in probability_forecast[0:3]: if forecast[path[1]][path[2]] is not None: diff --git a/homeassistant/components/meteo_france/weather.py b/homeassistant/components/meteo_france/weather.py index a30a65304b0..2727b4470c1 100644 --- a/homeassistant/components/meteo_france/weather.py +++ b/homeassistant/components/meteo_france/weather.py @@ -102,6 +102,11 @@ class MeteoFranceWeather(CoordinatorEntity, WeatherEntity): @property def device_info(self) -> DeviceInfo: """Return the device info.""" + assert ( + self.platform + and self.platform.config_entry + and self.platform.config_entry.unique_id + ) return DeviceInfo( entry_type=DeviceEntryType.SERVICE, identifiers={(DOMAIN, self.platform.config_entry.unique_id)}, diff --git a/mypy.ini b/mypy.ini index fc99119cda3..1f0018a4c05 100644 --- a/mypy.ini +++ b/mypy.ini @@ -2701,12 +2701,6 @@ ignore_errors = true [mypy-homeassistant.components.lovelace.websocket] ignore_errors = true -[mypy-homeassistant.components.meteo_france.sensor] -ignore_errors = true - -[mypy-homeassistant.components.meteo_france.weather] -ignore_errors = true - [mypy-homeassistant.components.minecraft_server] ignore_errors = true diff --git a/script/hassfest/mypy_config.py b/script/hassfest/mypy_config.py index 7f1faf00bb6..3aedaced494 100644 --- a/script/hassfest/mypy_config.py +++ b/script/hassfest/mypy_config.py @@ -42,8 +42,6 @@ IGNORED_MODULES: Final[list[str]] = [ "homeassistant.components.lovelace.dashboard", "homeassistant.components.lovelace.resources", "homeassistant.components.lovelace.websocket", - "homeassistant.components.meteo_france.sensor", - "homeassistant.components.meteo_france.weather", "homeassistant.components.minecraft_server", "homeassistant.components.minecraft_server.helpers", "homeassistant.components.minecraft_server.sensor",