Return ISO formated datetime in forecast (#14975)
* Return ISO formated datetime in forecast * Lintpull/14986/head
parent
9efa31ef9f
commit
d0cbbe6141
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue