Jewish calendar - Fix Parasha values (#144646)

* Fix Parasha values

* Fix test

* Update sensor.py
This commit is contained in:
Tsvi Mostovicz 2025-05-14 07:08:47 +03:00 committed by GitHub
parent f0c5fbfb8a
commit b1ffcb4245
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -275,9 +275,9 @@ class JewishCalendarSensor(JewishCalendarEntity, SensorEntity):
}
return after_shkia_date.hdate
if self.entity_description.key == "weekly_portion":
self._attr_options = list(Parasha)
self._attr_options = [str(p) for p in Parasha]
# Compute the weekly portion based on the upcoming shabbat.
return after_tzais_date.upcoming_shabbat.parasha
return str(after_tzais_date.upcoming_shabbat.parasha)
if self.entity_description.key == "holiday":
_holidays = after_shkia_date.holidays
_id = ", ".join(holiday.name for holiday in _holidays)

View File

@ -96,7 +96,7 @@ TEST_PARAMS = [
"device_class": "enum",
"friendly_name": "Jewish Calendar Weekly Torah portion",
"icon": "mdi:book-open-variant",
"options": list(Parasha),
"options": [str(p) for p in Parasha],
},
},
"he",