mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Enable basic type checking for aemet (#54925)
This commit is contained in:
parent
09ee7fc021
commit
dbc4470979
@ -1,4 +1,6 @@
|
||||
"""Weather data coordinator for the AEMET OpenData service."""
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
@ -95,7 +97,7 @@ def format_condition(condition: str) -> str:
|
||||
return condition
|
||||
|
||||
|
||||
def format_float(value) -> float:
|
||||
def format_float(value) -> float | None:
|
||||
"""Try converting string to float."""
|
||||
try:
|
||||
return float(value)
|
||||
@ -103,7 +105,7 @@ def format_float(value) -> float:
|
||||
return None
|
||||
|
||||
|
||||
def format_int(value) -> int:
|
||||
def format_int(value) -> int | None:
|
||||
"""Try converting string to int."""
|
||||
try:
|
||||
return int(value)
|
||||
|
3
mypy.ini
3
mypy.ini
@ -1268,9 +1268,6 @@ warn_unreachable = false
|
||||
[mypy-homeassistant.components.adguard.*]
|
||||
ignore_errors = true
|
||||
|
||||
[mypy-homeassistant.components.aemet.*]
|
||||
ignore_errors = true
|
||||
|
||||
[mypy-homeassistant.components.almond.*]
|
||||
ignore_errors = true
|
||||
|
||||
|
@ -15,7 +15,6 @@ from .model import Config, Integration
|
||||
# Do your best to not add anything new here.
|
||||
IGNORED_MODULES: Final[list[str]] = [
|
||||
"homeassistant.components.adguard.*",
|
||||
"homeassistant.components.aemet.*",
|
||||
"homeassistant.components.almond.*",
|
||||
"homeassistant.components.analytics.*",
|
||||
"homeassistant.components.atag.*",
|
||||
|
Loading…
x
Reference in New Issue
Block a user