Fix jewish calendar sensor with language set to english (#17104)

* Add failing testcase for issue #16830

* Fix for #16830
This commit is contained in:
Tsvi Mostovicz authored and Fabian Affolter committed 2018-10-03 18:43:25 +02:00
1 parent 467a59a6ed
commit cf5f02b347
2 files changed
+18 -2

No files matched your search

@@ -116,10 +116,14 @@ class JewishCalSensor(Entity):
date.get_reading(self.diaspora), hebrew=self._hebrew)
elif self.type == 'holiday_name':
try:
self._state = next(
x.description[self._hebrew].long
description = next(
x.description[self._hebrew]
for x in hdate.htables.HOLIDAYS
if x.index == date.get_holyday())
if not self._hebrew:
self._state = description
else:
self._state = description.long
except StopIteration:
self._state = None
elif self.type == 'holyness':