Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions homeassistant/components/jewish_calendar/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class JewishCalendarTimestampSensorDescription(JewishCalendarBaseSensorDescripti
attr_fn=lambda info: {
"hebrew_year": str(info.hdate.year),
"hebrew_month_name": str(info.hdate.month),
"hebrew_month_order": str(info.hdate.month.value),
"hebrew_month_biblical_order": str(info.hdate.month.biblical_order),
"hebrew_day": str(info.hdate.day),
},
),
Expand Down
4 changes: 4 additions & 0 deletions homeassistant/components/jewish_calendar/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
"state_attributes": {
"hebrew_year": { "name": "Hebrew year" },
"hebrew_month_name": { "name": "Hebrew month name" },
"hebrew_month_order": { "name": "Hebrew month order" },
"hebrew_month_biblical_order": {
"name": "Hebrew month biblical order"
},
"hebrew_day": { "name": "Hebrew day" }
}
},
Expand Down
16 changes: 8 additions & 8 deletions homeassistant/components/uptimerobot/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from __future__ import annotations

from typing import TYPE_CHECKING

from pyuptimerobot import (
UptimeRobot,
UptimeRobotAuthenticationException,
Expand Down Expand Up @@ -51,7 +53,12 @@ async def _async_update_data(self) -> list[UptimeRobotMonitor]:
raise UpdateFailed(exception) from exception

if response.status != API_ATTR_OK:
raise UpdateFailed(response.error.message)
raise UpdateFailed(
response.error.message if response.error else "Unknown error"
)

if TYPE_CHECKING:
assert isinstance(response.data, list)

monitors: list[UptimeRobotMonitor] = response.data

Expand All @@ -70,11 +77,4 @@ async def _async_update_data(self) -> list[UptimeRobotMonitor]:
remove_config_entry_id=self.config_entry.entry_id,
)

# If there are new monitors, we should reload the config entry so we can
# create new devices and entities.
if self.data and new_monitors - current_monitors:
self.hass.async_create_task(
self.hass.config_entries.async_reload(self.config_entry.entry_id)
)

return monitors
2 changes: 2 additions & 0 deletions tests/components/jewish_calendar/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ async def test_min_config(hass: HomeAssistant, config_entry: MockConfigEntry) ->
"attr": {
"hebrew_year": "5779",
"hebrew_month_name": "מרחשוון",
"hebrew_month_order": "2",
"hebrew_month_biblical_order": "8",
"hebrew_day": "6",
"friendly_name": "Jewish Calendar Date",
},
Expand Down
Loading