Simple_alarm component notifies user on alarm

This commit is contained in:
Paulus Schoutsen 2015-01-04 01:24:25 -08:00
parent 4fec2dcb28
commit 490543093d

View File

@ -34,6 +34,7 @@ def setup(hass, config):
device_tracker = loader.get_component('device_tracker')
light = loader.get_component('light')
notify = loader.get_component('notify')
light_ids = []
@ -67,6 +68,10 @@ def setup(hass, config):
hass, unknown_light_id,
flash=light.FLASH_LONG, rgb_color=[255, 0, 0])
# Send a message to the user
notify.send_message(
hass, "The lights just got turned on while no one was home.")
# Setup services to test the effect
hass.services.register(
DOMAIN, SERVICE_TEST_KNOWN_ALARM, lambda call: known_alarm())