From 6a1cf9827cc735574da664faa97000481f1d6770 Mon Sep 17 00:00:00 2001 From: Aviad Levy Date: Mon, 20 Oct 2025 20:06:31 +0300 Subject: [PATCH 1/2] Add month order attributes to Jewish calendar sensor (#154809) --- homeassistant/components/jewish_calendar/sensor.py | 2 ++ homeassistant/components/jewish_calendar/strings.json | 4 ++++ tests/components/jewish_calendar/test_sensor.py | 2 ++ 3 files changed, 8 insertions(+) diff --git a/homeassistant/components/jewish_calendar/sensor.py b/homeassistant/components/jewish_calendar/sensor.py index d9ad89237f53cc..0ccbf1970d8e8e 100644 --- a/homeassistant/components/jewish_calendar/sensor.py +++ b/homeassistant/components/jewish_calendar/sensor.py @@ -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), }, ), diff --git a/homeassistant/components/jewish_calendar/strings.json b/homeassistant/components/jewish_calendar/strings.json index ecfb6a472e6047..b58f144effc868 100644 --- a/homeassistant/components/jewish_calendar/strings.json +++ b/homeassistant/components/jewish_calendar/strings.json @@ -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" } } }, diff --git a/tests/components/jewish_calendar/test_sensor.py b/tests/components/jewish_calendar/test_sensor.py index ab24d35f932330..0f1dbdc930fa19 100644 --- a/tests/components/jewish_calendar/test_sensor.py +++ b/tests/components/jewish_calendar/test_sensor.py @@ -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", }, From 080b16a33da4d189c12d932d4923a8550cae6339 Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Mon, 20 Oct 2025 20:42:15 +0200 Subject: [PATCH 2/2] Cleanup code for UptimeRobot (#154892) --- .../components/uptimerobot/coordinator.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/uptimerobot/coordinator.py b/homeassistant/components/uptimerobot/coordinator.py index 78866800effb75..7ea6e54bd9f5fd 100644 --- a/homeassistant/components/uptimerobot/coordinator.py +++ b/homeassistant/components/uptimerobot/coordinator.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import TYPE_CHECKING + from pyuptimerobot import ( UptimeRobot, UptimeRobotAuthenticationException, @@ -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 @@ -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