mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Bump pyopenweathermap to v0.2.1 (#128892)
This commit is contained in:
parent
838519e89f
commit
25f66e6ac0
@ -192,12 +192,13 @@ class WeatherUpdateCoordinator(DataUpdateCoordinator):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_precipitation_value(precipitation):
|
def _get_precipitation_value(precipitation):
|
||||||
"""Get precipitation value from weather data."""
|
"""Get precipitation value from weather data."""
|
||||||
if "all" in precipitation:
|
if precipitation is not None:
|
||||||
return round(precipitation["all"], 2)
|
if "all" in precipitation:
|
||||||
if "3h" in precipitation:
|
return round(precipitation["all"], 2)
|
||||||
return round(precipitation["3h"], 2)
|
if "3h" in precipitation:
|
||||||
if "1h" in precipitation:
|
return round(precipitation["3h"], 2)
|
||||||
return round(precipitation["1h"], 2)
|
if "1h" in precipitation:
|
||||||
|
return round(precipitation["1h"], 2)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def _get_condition(self, weather_code, timestamp=None):
|
def _get_condition(self, weather_code, timestamp=None):
|
||||||
|
@ -6,5 +6,5 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/openweathermap",
|
"documentation": "https://www.home-assistant.io/integrations/openweathermap",
|
||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
"loggers": ["pyopenweathermap"],
|
"loggers": ["pyopenweathermap"],
|
||||||
"requirements": ["pyopenweathermap==0.1.1"]
|
"requirements": ["pyopenweathermap==0.2.1"]
|
||||||
}
|
}
|
||||||
|
@ -2113,7 +2113,7 @@ pyombi==0.1.10
|
|||||||
pyopenuv==2023.02.0
|
pyopenuv==2023.02.0
|
||||||
|
|
||||||
# homeassistant.components.openweathermap
|
# homeassistant.components.openweathermap
|
||||||
pyopenweathermap==0.1.1
|
pyopenweathermap==0.2.1
|
||||||
|
|
||||||
# homeassistant.components.opnsense
|
# homeassistant.components.opnsense
|
||||||
pyopnsense==0.4.0
|
pyopnsense==0.4.0
|
||||||
|
@ -1700,7 +1700,7 @@ pyoctoprintapi==0.1.12
|
|||||||
pyopenuv==2023.02.0
|
pyopenuv==2023.02.0
|
||||||
|
|
||||||
# homeassistant.components.openweathermap
|
# homeassistant.components.openweathermap
|
||||||
pyopenweathermap==0.1.1
|
pyopenweathermap==0.2.1
|
||||||
|
|
||||||
# homeassistant.components.opnsense
|
# homeassistant.components.opnsense
|
||||||
pyopnsense==0.4.0
|
pyopnsense==0.4.0
|
||||||
|
@ -7,6 +7,7 @@ from pyopenweathermap import (
|
|||||||
CurrentWeather,
|
CurrentWeather,
|
||||||
DailyTemperature,
|
DailyTemperature,
|
||||||
DailyWeatherForecast,
|
DailyWeatherForecast,
|
||||||
|
MinutelyWeatherForecast,
|
||||||
RequestError,
|
RequestError,
|
||||||
WeatherCondition,
|
WeatherCondition,
|
||||||
WeatherReport,
|
WeatherReport,
|
||||||
@ -105,7 +106,12 @@ def _create_mocked_owm_factory(is_valid: bool):
|
|||||||
rain=0,
|
rain=0,
|
||||||
snow=0,
|
snow=0,
|
||||||
)
|
)
|
||||||
weather_report = WeatherReport(current_weather, [], [daily_weather_forecast])
|
minutely_weather_forecast = MinutelyWeatherForecast(
|
||||||
|
date_time=1728672360, precipitation=2.54
|
||||||
|
)
|
||||||
|
weather_report = WeatherReport(
|
||||||
|
current_weather, [minutely_weather_forecast], [], [daily_weather_forecast]
|
||||||
|
)
|
||||||
|
|
||||||
mocked_owm_client = MagicMock()
|
mocked_owm_client = MagicMock()
|
||||||
mocked_owm_client.validate_key = AsyncMock(return_value=is_valid)
|
mocked_owm_client.validate_key = AsyncMock(return_value=is_valid)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user