Return Jewish Calendar holiday type id support (#29168)
* Bring back holiday type id as a attribute to the holiday sensor * Add test for holiday type id attribute
This commit is contained in:
1 parent
fa1622fe8b
commit
d7a66e6e4c
2 files changed
+4
-2
No files matched your search
@@ -122,8 +122,9 @@ class JewishCalendarSensor(Entity):
|
||||
# Compute the weekly portion based on the upcoming shabbat.
|
||||
return after_tzais_date.upcoming_shabbat.parasha
|
||||
if self._type == "holiday":
|
||||
self._holiday_attrs["type"] = after_shkia_date.holiday_type.name
|
||||
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
|
||||
return after_shkia_date.holiday_description
|
||||
if self._type == "omer_count":
|
||||
return after_shkia_date.omer_day
|
||||
|
||||
@@ -180,8 +180,9 @@ async def test_jewish_calendar_sensor(
|
||||
assert sensor_object.state == str(result)
|
||||
|
||||
if sensor == "holiday":
|
||||
assert sensor_object.attributes.get("type") == "YOM_TOV"
|
||||
assert sensor_object.attributes.get("id") == "rosh_hashana_i"
|
||||
assert sensor_object.attributes.get("type") == "YOM_TOV"
|
||||
assert sensor_object.attributes.get("type_id") == 1
|
||||
|
||||
|
||||
SHABBAT_PARAMS = [
|
||||
|
||||
Reference in new issue
Block a user