1
0
mirror of https://github.com/MarkParker5/STARK.git synced 2025-07-02 22:36:54 +02:00
Files
STARK/Features/SmartHome/light.py

61 lines
1.6 KiB
Python
Raw Normal View History

2021-03-23 00:55:30 +02:00
from .SmartHome import *
from ArchieCore import Response
2021-03-23 00:55:30 +02:00
################################################################################
def method(params):
SmartHome.send({
'target': 'main_light',
'cmd': 'light_on',
})
voice = text = ''
return Response(text = text, voice = voice)
patterns = ['* (включ|выключ)* свет *']
main_light = SmartHome('main_light', patterns)
2021-03-23 00:55:30 +02:00
main_light.setStart(method)
################################################################################
# led
def method(params):
SmartHome.send({
'target': 'led',
'cmd': 'led_on',
})
voice = text = ''
return Response(text = text, voice = voice)
patterns = ['* включи* подсветку *']
light_on = SmartHome('led_on', patterns)
2021-03-23 00:55:30 +02:00
light_on.setStart(method)
################################################################################
def method(params):
SmartHome.send({
'target': 'led',
'cmd': 'led_off',
})
voice = text = ''
return Response(text = text, voice = voice)
patterns = ['* выключи* подсветку *']
led_off = SmartHome('led_off', patterns)
2021-03-23 00:55:30 +02:00
led_off.setStart(method)
################################################################################
def method(params):
SmartHome.send({
'target': 'led',
'cmd': 'led_hello',
})
voice = text = ''
return Response(text = text, voice = voice)
patterns = []
led_hello = SmartHome('led_hello', patterns)
2021-03-23 00:55:30 +02:00
led_hello.setStart(method)
################################################################################