diff --git a/homeassistant/components/tomorrowio/entity.py b/homeassistant/components/tomorrowio/entity.py index 6560ac58724..f00677b1561 100644 --- a/homeassistant/components/tomorrowio/entity.py +++ b/homeassistant/components/tomorrowio/entity.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Any + from pytomorrowio.const import CURRENT from homeassistant.config_entries import ConfigEntry @@ -36,7 +38,7 @@ class TomorrowioEntity(CoordinatorEntity[TomorrowioDataUpdateCoordinator]): entry_type=DeviceEntryType.SERVICE, ) - def _get_current_property(self, property_name: str) -> int | str | float | None: + def _get_current_property(self, property_name: str) -> Any | None: """Get property from current conditions. Used for V4 API. diff --git a/homeassistant/components/tomorrowio/weather.py b/homeassistant/components/tomorrowio/weather.py index 0a070a1b33b..36b85515c3c 100644 --- a/homeassistant/components/tomorrowio/weather.py +++ b/homeassistant/components/tomorrowio/weather.py @@ -175,37 +175,37 @@ class TomorrowioWeatherEntity(TomorrowioEntity, SingleCoordinatorWeatherEntity): return CONDITIONS[condition] @property - def native_temperature(self): + def native_temperature(self) -> float | None: """Return the platform temperature.""" return self._get_current_property(TMRW_ATTR_TEMPERATURE) @property - def native_pressure(self): + def native_pressure(self) -> float | None: """Return the raw pressure.""" return self._get_current_property(TMRW_ATTR_PRESSURE) @property - def humidity(self): + def humidity(self) -> float | None: """Return the humidity.""" return self._get_current_property(TMRW_ATTR_HUMIDITY) @property - def native_wind_speed(self): + def native_wind_speed(self) -> float | None: """Return the raw wind speed.""" return self._get_current_property(TMRW_ATTR_WIND_SPEED) @property - def wind_bearing(self): + def wind_bearing(self) -> float | None: """Return the wind bearing.""" return self._get_current_property(TMRW_ATTR_WIND_DIRECTION) @property - def ozone(self): + def ozone(self) -> float | None: """Return the O3 (ozone) level.""" return self._get_current_property(TMRW_ATTR_OZONE) @property - def condition(self): + def condition(self) -> str | None: """Return the condition.""" return self._translate_condition( self._get_current_property(TMRW_ATTR_CONDITION), @@ -213,7 +213,7 @@ class TomorrowioWeatherEntity(TomorrowioEntity, SingleCoordinatorWeatherEntity): ) @property - def native_visibility(self): + def native_visibility(self) -> float | None: """Return the raw visibility.""" return self._get_current_property(TMRW_ATTR_VISIBILITY)