You've already forked STARK
mirror of
https://github.com/MarkParker5/STARK.git
synced 2025-06-27 22:28:33 +02:00
65 lines
1.7 KiB
Python
65 lines
1.7 KiB
Python
from .SmartHome import *
|
|
from ..Command import Response
|
|
################################################################################
|
|
|
|
def method(params):
|
|
SmartHome.send({
|
|
'target': 'main_light',
|
|
'cmd': 'light_on',
|
|
})
|
|
voice = text = ''
|
|
return Response(text = text, voice = voice)
|
|
|
|
keywords = {}
|
|
patterns = ['* (включ|выключ)* свет *']
|
|
main_light = SmartHome('main_light', keywords, patterns)
|
|
main_light.setStart(method)
|
|
|
|
################################################################################
|
|
# led
|
|
|
|
def method(params):
|
|
SmartHome.send({
|
|
'target': 'led',
|
|
'cmd': 'led_on',
|
|
})
|
|
voice = text = ''
|
|
return Response(text = text, voice = voice)
|
|
|
|
keywords = {}
|
|
patterns = ['* включи* подсветку *']
|
|
light_on = SmartHome('led_on', keywords, patterns)
|
|
light_on.setStart(method)
|
|
|
|
################################################################################
|
|
|
|
def method(params):
|
|
SmartHome.send({
|
|
'target': 'led',
|
|
'cmd': 'led_off',
|
|
})
|
|
voice = text = ''
|
|
return Response(text = text, voice = voice)
|
|
|
|
keywords = {}
|
|
patterns = ['* выключи* подсветку *']
|
|
led_off = SmartHome('led_off', keywords, patterns)
|
|
led_off.setStart(method)
|
|
|
|
################################################################################
|
|
|
|
def method(params):
|
|
SmartHome.send({
|
|
'target': 'led',
|
|
'cmd': 'led_hello',
|
|
})
|
|
voice = text = ''
|
|
return Response(text = text, voice = voice)
|
|
|
|
keywords = {}
|
|
patterns = []
|
|
led_hello = SmartHome('led_hello', keywords, patterns)
|
|
led_hello.setStart(method)
|
|
|
|
################################################################################
|