Skip to content
Snippets Groups Projects
Commit d0cbbe61 authored by c727's avatar c727 Committed by Paulus Schoutsen
Browse files

Return ISO formated datetime in forecast (#14975)

* Return ISO formated datetime in forecast

* Lint
parent 9efa31ef
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ Support for displaying weather info from Ecobee API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/weather.ecobee/
"""
from datetime import datetime
from homeassistant.components import ecobee
from homeassistant.components.weather import (
WeatherEntity, ATTR_FORECAST_CONDITION, ATTR_FORECAST_TEMP,
......@@ -134,8 +135,10 @@ class EcobeeWeather(WeatherEntity):
try:
forecasts = []
for day in self.weather['forecasts']:
date_time = datetime.strptime(day['dateTime'],
'%Y-%m-%d %H:%M:%S').isoformat()
forecast = {
ATTR_FORECAST_TIME: day['dateTime'],
ATTR_FORECAST_TIME: date_time,
ATTR_FORECAST_CONDITION: day['condition'],
ATTR_FORECAST_TEMP: float(day['tempHigh']) / 10,
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment