Skip to content

Commit

Permalink
Bump aioautomower to 2024.9.1 (#126315)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas55555 authored Sep 20, 2024
1 parent cd95c13 commit f93bcba
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 20 deletions.
32 changes: 23 additions & 9 deletions homeassistant/components/husqvarna_automower/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from datetime import datetime
import logging

from aioautomower.model import make_name_string

from homeassistant.components.calendar import CalendarEntity, CalendarEvent
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
Expand Down Expand Up @@ -54,8 +56,13 @@ def event(self) -> CalendarEvent | None:
_LOGGER.debug("program_event %s", program_event)
if not program_event:
return None
work_area_name = None
if self.mower_attributes.work_area_dict and program_event.work_area_id:
work_area_name = self.mower_attributes.work_area_dict[
program_event.work_area_id
]
return CalendarEvent(
summary=program_event.schedule_name,
summary=make_name_string(work_area_name, program_event.schedule_no),
start=program_event.start.replace(tzinfo=dt_util.DEFAULT_TIME_ZONE),
end=program_event.end.replace(tzinfo=dt_util.DEFAULT_TIME_ZONE),
rrule=program_event.rrule_str,
Expand All @@ -75,12 +82,19 @@ async def async_get_events(
start_date,
end_date,
)
return [
CalendarEvent(
summary=program_event.schedule_name,
start=program_event.start.replace(tzinfo=start_date.tzinfo),
end=program_event.end.replace(tzinfo=start_date.tzinfo),
rrule=program_event.rrule_str,
calendar_events = []
for program_event in cursor:
work_area_name = None
if self.mower_attributes.work_area_dict and program_event.work_area_id:
work_area_name = self.mower_attributes.work_area_dict[
program_event.work_area_id
]
calendar_events.append(
CalendarEvent(
summary=make_name_string(work_area_name, program_event.schedule_no),
start=program_event.start.replace(tzinfo=start_date.tzinfo),
end=program_event.end.replace(tzinfo=start_date.tzinfo),
rrule=program_event.rrule_str,
)
)
for program_event in cursor
]
return calendar_events
2 changes: 1 addition & 1 deletion homeassistant/components/husqvarna_automower/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"documentation": "https://www.home-assistant.io/integrations/husqvarna_automower",
"iot_class": "cloud_push",
"loggers": ["aioautomower"],
"requirements": ["aioautomower==2024.9.0"]
"requirements": ["aioautomower==2024.9.1"]
}
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ aioaseko==1.0.0
aioasuswrt==1.4.0

# homeassistant.components.husqvarna_automower
aioautomower==2024.9.0
aioautomower==2024.9.1

# homeassistant.components.azure_devops
aioazuredevops==2.2.1
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ aioaseko==1.0.0
aioasuswrt==1.4.0

# homeassistant.components.husqvarna_automower
aioautomower==2024.9.0
aioautomower==2024.9.1

# homeassistant.components.azure_devops
aioazuredevops==2.2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
'thursday': False,
'tuesday': False,
'wednesday': True,
'work_area_id': 123456,
'work_area_name': 'Front lawn',
'workAreaId': 123456,
}),
dict({
'duration': 480,
Expand All @@ -29,8 +28,7 @@
'thursday': True,
'tuesday': True,
'wednesday': False,
'work_area_id': 123456,
'work_area_name': 'Front lawn',
'workAreaId': 123456,
}),
dict({
'duration': 480,
Expand All @@ -42,8 +40,7 @@
'thursday': True,
'tuesday': True,
'wednesday': False,
'work_area_id': 654321,
'work_area_name': 'Back lawn',
'workAreaId': 654321,
}),
dict({
'duration': 480,
Expand All @@ -55,8 +52,7 @@
'thursday': True,
'tuesday': True,
'wednesday': False,
'work_area_id': 654321,
'work_area_name': 'Back lawn',
'workAreaId': 654321,
}),
]),
}),
Expand Down

0 comments on commit f93bcba

Please sign in to comment.