forked from home-assistant/core
Clean holiday attributes code in Jewish calendar (#55080)
* Clean repetitive code in jewish calendar * do not return none * fix holiday
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user