mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 01:38:02 +00:00
Simple_alarm component notifies user on alarm
This commit is contained in:
parent
4fec2dcb28
commit
490543093d
@ -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())
|
||||
|
Loading…
x
Reference in New Issue
Block a user