Return empty dictionary at first for attributes (#41348)

This commit is contained in:
springstan
2020-10-06 18:08:53 +02:00
committed by GitHub
parent 4d12fcc218
commit 61d9067a49
16 changed files with 75 additions and 77 deletions

View File

@@ -113,10 +113,9 @@ class JewishCalendarSensor(Entity):
@property
def device_state_attributes(self):
"""Return the state attributes."""
if self._type == "holiday":
return self._holiday_attrs
return {}
if self._type != "holiday":
return {}
return self._holiday_attrs
def get_state(self, daytime_date, after_shkia_date, after_tzais_date):
"""For a given type of sensor, return the state."""