diff --git a/homeassistant/components/husqvarna_automower/calendar.py b/homeassistant/components/husqvarna_automower/calendar.py index 2e1d9433fb7..87fac58beb2 100644 --- a/homeassistant/components/husqvarna_automower/calendar.py +++ b/homeassistant/components/husqvarna_automower/calendar.py @@ -7,7 +7,6 @@ from aioautomower.model import make_name_string from homeassistant.components.calendar import CalendarEntity, CalendarEvent from homeassistant.core import HomeAssistant -from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.util import dt as dt_util @@ -49,8 +48,6 @@ class AutomowerCalendarEntity(AutomowerBaseEntity, CalendarEntity): def event(self) -> CalendarEvent | None: """Return the current or next upcoming event.""" schedule = self.mower_attributes.calendar - if schedule.timeline is None: - return None cursor = schedule.timeline.active_after(dt_util.now()) program_event = next(cursor, None) _LOGGER.debug("program_event %s", program_event) @@ -76,8 +73,6 @@ class AutomowerCalendarEntity(AutomowerBaseEntity, CalendarEntity): This is only called when opening the calendar in the UI. """ schedule = self.mower_attributes.calendar - if schedule.timeline is None: - raise HomeAssistantError("Unable to get events: No schedule set") cursor = schedule.timeline.overlapping( start_date, end_date, diff --git a/homeassistant/components/husqvarna_automower/device_tracker.py b/homeassistant/components/husqvarna_automower/device_tracker.py index 74ad624a515..66997e1e86e 100644 --- a/homeassistant/components/husqvarna_automower/device_tracker.py +++ b/homeassistant/components/husqvarna_automower/device_tracker.py @@ -1,7 +1,5 @@ """Creates the device tracker entity for the mower.""" -from typing import TYPE_CHECKING - from homeassistant.components.device_tracker import SourceType, TrackerEntity from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback @@ -47,13 +45,9 @@ class AutomowerDeviceTrackerEntity(AutomowerBaseEntity, TrackerEntity): @property def latitude(self) -> float: """Return latitude value of the device.""" - if TYPE_CHECKING: - assert self.mower_attributes.positions is not None return self.mower_attributes.positions[0].latitude @property def longitude(self) -> float: """Return longitude value of the device.""" - if TYPE_CHECKING: - assert self.mower_attributes.positions is not None return self.mower_attributes.positions[0].longitude diff --git a/homeassistant/components/husqvarna_automower/manifest.json b/homeassistant/components/husqvarna_automower/manifest.json index 84d206c3363..aab633378ed 100644 --- a/homeassistant/components/husqvarna_automower/manifest.json +++ b/homeassistant/components/husqvarna_automower/manifest.json @@ -7,5 +7,5 @@ "documentation": "https://www.home-assistant.io/integrations/husqvarna_automower", "iot_class": "cloud_push", "loggers": ["aioautomower"], - "requirements": ["aioautomower==2024.9.1"] + "requirements": ["aioautomower==2024.9.2"] } diff --git a/requirements_all.txt b/requirements_all.txt index 445d0c79988..afe19a225c1 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -198,7 +198,7 @@ aioaseko==1.0.0 aioasuswrt==1.4.0 # homeassistant.components.husqvarna_automower -aioautomower==2024.9.1 +aioautomower==2024.9.2 # homeassistant.components.azure_devops aioazuredevops==2.2.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 1f21182dc25..d57a7059df2 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -186,7 +186,7 @@ aioaseko==1.0.0 aioasuswrt==1.4.0 # homeassistant.components.husqvarna_automower -aioautomower==2024.9.1 +aioautomower==2024.9.2 # homeassistant.components.azure_devops aioazuredevops==2.2.1