Enable basic type checking for aemet (#54925)

pull/55143/head
Erik Montnemery 2021-08-20 19:10:19 +02:00 committed by GitHub
parent 09ee7fc021
commit dbc4470979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 6 deletions

View File

@ -1,4 +1,6 @@
"""Weather data coordinator for the AEMET OpenData service.""" """Weather data coordinator for the AEMET OpenData service."""
from __future__ import annotations
from dataclasses import dataclass, field from dataclasses import dataclass, field
from datetime import timedelta from datetime import timedelta
import logging import logging
@ -95,7 +97,7 @@ def format_condition(condition: str) -> str:
return condition return condition
def format_float(value) -> float: def format_float(value) -> float | None:
"""Try converting string to float.""" """Try converting string to float."""
try: try:
return float(value) return float(value)
@ -103,7 +105,7 @@ def format_float(value) -> float:
return None return None
def format_int(value) -> int: def format_int(value) -> int | None:
"""Try converting string to int.""" """Try converting string to int."""
try: try:
return int(value) return int(value)

View File

@ -1268,9 +1268,6 @@ warn_unreachable = false
[mypy-homeassistant.components.adguard.*] [mypy-homeassistant.components.adguard.*]
ignore_errors = true ignore_errors = true
[mypy-homeassistant.components.aemet.*]
ignore_errors = true
[mypy-homeassistant.components.almond.*] [mypy-homeassistant.components.almond.*]
ignore_errors = true ignore_errors = true

View File

@ -15,7 +15,6 @@ from .model import Config, Integration
# Do your best to not add anything new here. # Do your best to not add anything new here.
IGNORED_MODULES: Final[list[str]] = [ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.adguard.*", "homeassistant.components.adguard.*",
"homeassistant.components.aemet.*",
"homeassistant.components.almond.*", "homeassistant.components.almond.*",
"homeassistant.components.analytics.*", "homeassistant.components.analytics.*",
"homeassistant.components.atag.*", "homeassistant.components.atag.*",