Skip to content

Commit 7ee2fc7

Browse files
committed
fix asyncio error when turning on/off schedule
1 parent 6c9668c commit 7ee2fc7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

custom_components/scheduler/switch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ async def async_timer_updated(self, id: str):
206206
self.schedule_id
207207
)
208208
)
209-
await self.coordinator.async_delete_schedule(self.schedule_id)
209+
self.coordinator.async_delete_schedule(self.schedule_id)
210210

211211
self._current_slot = self._timer_handler.current_slot
212212

@@ -455,14 +455,14 @@ async def async_turn_off(self):
455455
"""turn off a schedule"""
456456
if self.schedule[const.ATTR_ENABLED]:
457457
await self._action_handler.async_empty_queue()
458-
await self.coordinator.async_edit_schedule(
458+
self.coordinator.async_edit_schedule(
459459
self.schedule_id, {const.ATTR_ENABLED: False}
460460
)
461461

462462
async def async_turn_on(self):
463463
"""turn on a schedule"""
464464
if not self.schedule[const.ATTR_ENABLED]:
465-
await self.coordinator.async_edit_schedule(
465+
self.coordinator.async_edit_schedule(
466466
self.schedule_id, {const.ATTR_ENABLED: True}
467467
)
468468

0 commit comments

Comments
 (0)