moved fetch_weather to masked lat lon and
This commit is contained in:
@@ -257,7 +257,7 @@ def update_weather(config: Config) -> None:
|
|||||||
|
|
||||||
logger.info(f"Masked location: {masked_lat}, {masked_lon}")
|
logger.info(f"Masked location: {masked_lat}, {masked_lon}")
|
||||||
|
|
||||||
weather = fetch_weather(config.pirate_weather_api_key, lat, lon)
|
weather = fetch_weather(config.pirate_weather_api_key, masked_lat, masked_lon)
|
||||||
logger.info(f"Weather: {weather.temperature}°F, {weather.condition}")
|
logger.info(f"Weather: {weather.temperature}°F, {weather.condition}")
|
||||||
|
|
||||||
post_to_ha(config.ha_url, config.ha_token, weather)
|
post_to_ha(config.ha_url, config.ha_token, weather)
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
"""Models for van weather service."""
|
"""Models for van weather service."""
|
||||||
|
|
||||||
from datetime import datetime
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from datetime import datetime # noqa: TC003 This is required for pydantic
|
||||||
|
|
||||||
from pydantic import BaseModel, field_serializer
|
from pydantic import BaseModel, field_serializer
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user