diff --git a/homeassistant/components/meteo_france/__init__.py b/homeassistant/components/meteo_france/__init__.py index 89fcc3c98aa..d6460fd6e5a 100644 --- a/homeassistant/components/meteo_france/__init__.py +++ b/homeassistant/components/meteo_france/__init__.py @@ -121,7 +121,7 @@ def setup(hass, config): weather_alert_client.update_data() except VigilanceMeteoError as exp: _LOGGER.error( - "Unexpected error when creating the" "vigilance_meteoFrance proxy: %s ", + "Unexpected error when creating the vigilance_meteoFrance proxy: %s ", exp, ) else: diff --git a/homeassistant/components/meteo_france/weather.py b/homeassistant/components/meteo_france/weather.py index ce21e0f7d77..9a861d13c2e 100644 --- a/homeassistant/components/meteo_france/weather.py +++ b/homeassistant/components/meteo_france/weather.py @@ -1,5 +1,5 @@ """Support for Meteo-France weather service.""" -from datetime import datetime, timedelta +from datetime import timedelta import logging from homeassistant.components.weather import ( @@ -9,6 +9,7 @@ from homeassistant.components.weather import ( ATTR_FORECAST_TIME, WeatherEntity, ) +import homeassistant.util.dt as dt_util from homeassistant.const import TEMP_CELSIUS from . import ATTRIBUTION, CONDITION_CLASSES, CONF_CITY, DATA_METEO_FRANCE @@ -83,8 +84,9 @@ class MeteoFranceWeather(WeatherEntity): @property def forecast(self): """Return the forecast.""" - reftime = datetime.now().replace(hour=12, minute=00) + reftime = dt_util.utcnow().replace(hour=12, minute=0, second=0, microsecond=0) reftime += timedelta(hours=24) + _LOGGER.debug("reftime used for %s forecast: %s", self._data["name"], reftime) forecast_data = [] for key in self._data["forecast"]: value = self._data["forecast"][key]