Skip to content
Permalink
Browse files

Fixes issue with multiple alerts (#23945)

* Fixes issue with multiple alerts

* Adds missing new line

* Remove whitespace
  • Loading branch information...
ludeeus authored and pvizeli committed May 18, 2019
1 parent 91ba35c commit 57bd4185d42f9df0eef701926c7749dfb6096bf2
Showing with 3 additions and 2 deletions.
  1. +3 −2 homeassistant/components/alert/__init__.py
@@ -1,7 +1,7 @@
"""Support for repeating alerts when conditions are met."""
import asyncio
import logging
from datetime import datetime, timedelta
from datetime import timedelta

import voluptuous as vol

@@ -13,6 +13,7 @@
SERVICE_TURN_ON, SERVICE_TURN_OFF, SERVICE_TOGGLE, ATTR_ENTITY_ID)
from homeassistant.helpers import service, event
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.util.dt import now

_LOGGER = logging.getLogger(__name__)

@@ -222,7 +223,7 @@ def hidden(self):
async def _schedule_notify(self):
"""Schedule a notification."""
delay = self._delay[self._next_delay]
next_msg = datetime.now() + delay
next_msg = now() + delay
self._cancel = \
event.async_track_point_in_time(self.hass, self._notify, next_msg)
self._next_delay = min(self._next_delay + 1, len(self._delay) - 1)

0 comments on commit 57bd418

Please sign in to comment.
You can’t perform that action at this time.