Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions homeassistant/components/jewish_calendar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"weekly_portion": ["Parshat Hashavua", "mdi:book-open-variant"],
"holiday": ["Holiday", "mdi:calendar-star"],
"omer_count": ["Day of the Omer", "mdi:counter"],
"daf_yomi": ["Daf Yomi", "mdi:book-open-variant"],
},
"time": {
"first_light": ["Alot Hashachar", "mdi:weather-sunset-up"],
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/jewish_calendar/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"domain": "jewish_calendar",
"name": "Jewish Calendar",
"documentation": "https://www.home-assistant.io/integrations/jewish_calendar",
"requirements": ["hdate==0.9.3"],
"requirements": ["hdate==0.9.5"],
"dependencies": [],
"codeowners": ["@tsvi"]
}
8 changes: 5 additions & 3 deletions homeassistant/components/jewish_calendar/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async def async_update(self):
if today_times.havdalah and now > today_times.havdalah:
after_tzais_date = date.next_day

self._state = self.get_state(after_shkia_date, after_tzais_date)
self._state = self.get_state(date, after_shkia_date, after_tzais_date)
_LOGGER.debug("New value for %s: %s", self._type, self._state)

def make_zmanim(self, date):
Expand All @@ -112,7 +112,7 @@ def device_state_attributes(self):

return {}

def get_state(self, after_shkia_date, after_tzais_date):
def get_state(self, date, after_shkia_date, after_tzais_date):
Comment thread
moshekaplan marked this conversation as resolved.
Outdated
"""For a given type of sensor, return the state."""
# Terminology note: by convention in py-libhdate library, "upcoming"
# refers to "current" or "upcoming" dates.
Expand All @@ -128,6 +128,8 @@ def get_state(self, after_shkia_date, after_tzais_date):
return after_shkia_date.holiday_description
if self._type == "omer_count":
return after_shkia_date.omer_day
if self._type == "daf_yomi":
return date.daf_yomi

return None

Expand Down Expand Up @@ -157,7 +159,7 @@ def device_state_attributes(self):

return attrs

def get_state(self, after_shkia_date, after_tzais_date):
def get_state(self, date, after_shkia_date, after_tzais_date):
"""For a given type of sensor, return the state."""
if self._type == "upcoming_shabbat_candle_lighting":
times = self.make_zmanim(
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ hass-nabucasa==0.31
hbmqtt==0.9.5

# homeassistant.components.jewish_calendar
hdate==0.9.3
hdate==0.9.5

# homeassistant.components.heatmiser
heatmiserV3==1.1.18
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ hass-nabucasa==0.31
hbmqtt==0.9.5

# homeassistant.components.jewish_calendar
hdate==0.9.3
hdate==0.9.5

# homeassistant.components.here_travel_time
herepy==2.0.0
Expand Down