Clean holiday attributes code in Jewish calendar (#55080)
* Clean repetitive code in jewish calendar * do not return none * fix holidaypull/55650/head
parent
91cd6951f3
commit
173b87e675
|
@ -230,9 +230,11 @@ class JewishCalendarSensor(SensorEntity):
|
|||
# Compute the weekly portion based on the upcoming shabbat.
|
||||
return after_tzais_date.upcoming_shabbat.parasha
|
||||
if self.entity_description.key == "holiday":
|
||||
self._holiday_attrs["id"] = after_shkia_date.holiday_name
|
||||
self._holiday_attrs["type"] = after_shkia_date.holiday_type.name
|
||||
self._holiday_attrs["type_id"] = after_shkia_date.holiday_type.value
|
||||
self._holiday_attrs = {
|
||||
"id": after_shkia_date.holiday_name,
|
||||
"type": after_shkia_date.holiday_type.name,
|
||||
"type_id": after_shkia_date.holiday_type.value,
|
||||
}
|
||||
return after_shkia_date.holiday_description
|
||||
if self.entity_description.key == "omer_count":
|
||||
return after_shkia_date.omer_day
|
||||
|
|
Loading…
Reference in New Issue