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

30 lines
1007 B
Python
Raw Normal View History

2020-11-23 02:25:18 +02:00
from .SmartHome import *
2021-02-27 14:21:28 +02:00
from Command import Response
2020-11-23 02:25:18 +02:00
################################################################################
def method(params):
SmartHome.send({
'target': 'window',
'cmd': 'window_open',
})
2021-04-17 16:18:46 +03:00
voice = text = ''
return Response(text = text, voice = voice)
2020-11-23 02:25:18 +02:00
patterns = ['* (открыть|открой) (окно|окна) *', '* (подними|поднять) (шторы|роллеты) *']
window_open = SmartHome('window_open', patterns)
2020-11-23 02:25:18 +02:00
window_open.setStart(method)
################################################################################
def method(params):
SmartHome.send({
'target': 'window',
'cmd': 'window_close',
})
2021-04-17 16:18:46 +03:00
voice = text = ''
return Response(text = text, voice = voice)
2020-11-23 02:25:18 +02:00
patterns = ['* (закрыть|закрой) (окно|окна) *', '* (опусти|опустить) (шторы|роллеты) *']
window_close = SmartHome('window_close', patterns)
2020-11-23 02:25:18 +02:00
window_close.setStart(method)