Remove meteo_france from mypy ignore list (#74613)

This commit is contained in:
epenet 2022-07-07 19:50:08 +02:00 committed by GitHub
parent f2706aa8c0
commit dc0c41982f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 10 deletions

View file

@ -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: [

View file

@ -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:

View file

@ -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)},

View file

@ -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

View file

@ -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",