Fix device_tracker service call & cleanup (#17173)

* Bugfix group service - device_tracker

* Cleanup
This commit is contained in:
cdce8p 2018-10-05 23:09:55 +02:00 committed by Paulus Schoutsen
parent a66db59359
commit 07d90c6c55
5 changed files with 51 additions and 43 deletions

View file

@ -10,6 +10,8 @@ import logging
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_MESSAGE, DOMAIN as DOMAIN_NOTIFY)
from homeassistant.const import (
CONF_ENTITY_ID, STATE_IDLE, CONF_NAME, CONF_STATE, STATE_ON, STATE_OFF,
SERVICE_TURN_ON, SERVICE_TURN_OFF, SERVICE_TOGGLE, ATTR_ENTITY_ID)
@ -204,7 +206,7 @@ class Alert(ToggleEntity):
self._send_done_message = True
for target in self._notifiers:
await self.hass.services.async_call(
'notify', target, {'message': self._name})
DOMAIN_NOTIFY, target, {ATTR_MESSAGE: self._name})
await self._schedule_notify()
async def _notify_done_message(self, *args):
@ -213,7 +215,7 @@ class Alert(ToggleEntity):
self._send_done_message = False
for target in self._notifiers:
await self.hass.services.async_call(
'notify', target, {'message': self._done_message})
DOMAIN_NOTIFY, target, {ATTR_MESSAGE: self._done_message})
async def async_turn_on(self, **kwargs):
"""Async Unacknowledge alert."""