Fix islamic prayer times timestamp sensor (#61207)

pull/61241/head
Paulus Schoutsen 2021-12-07 23:39:27 -08:00 committed by GitHub
parent 7b3a7ee2d1
commit b7539fc0de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -45,10 +45,8 @@ class IslamicPrayerTimeSensor(SensorEntity):
@property @property
def native_value(self): def native_value(self):
"""Return the state of the sensor.""" """Return the state of the sensor."""
return ( return self.client.prayer_times_info.get(self.sensor_type).astimezone(
self.client.prayer_times_info.get(self.sensor_type) dt_util.UTC
.astimezone(dt_util.UTC)
.isoformat()
) )
async def async_added_to_hass(self): async def async_added_to_hass(self):

View File

@ -5,6 +5,7 @@ import pytest
from homeassistant import config_entries, data_entry_flow from homeassistant import config_entries, data_entry_flow
from homeassistant.components import islamic_prayer_times from homeassistant.components import islamic_prayer_times
from homeassistant.components.islamic_prayer_times import config_flow # noqa: F401
from homeassistant.components.islamic_prayer_times.const import CONF_CALC_METHOD, DOMAIN from homeassistant.components.islamic_prayer_times.const import CONF_CALC_METHOD, DOMAIN
from tests.common import MockConfigEntry from tests.common import MockConfigEntry