Fix AEMET town timestamp format (#48647)

Datetime should be converted to ISO format.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
Álvaro Fernández Rojas 2021-04-03 11:17:17 +02:00 committed by GitHub
parent cee43b0670
commit 2c61c0f258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -283,7 +283,7 @@ class WeatherUpdateCoordinator(DataUpdateCoordinator):
temperature_feeling = None
town_id = None
town_name = None
town_timestamp = dt_util.as_utc(elaborated)
town_timestamp = dt_util.as_utc(elaborated).isoformat()
wind_bearing = None
wind_max_speed = None
wind_speed = None

View File

@ -127,7 +127,7 @@ async def test_aemet_weather_create_sensors(hass):
assert state.state == "Getafe"
state = hass.states.get("sensor.aemet_town_timestamp")
assert state.state == "2021-01-09 11:47:45+00:00"
assert state.state == "2021-01-09T11:47:45+00:00"
state = hass.states.get("sensor.aemet_wind_bearing")
assert state.state == "90.0"