1
0
mirror of https://github.com/MarkParker5/STARK.git synced 2025-07-12 22:50:22 +02:00

Create SmartHome.window

This commit is contained in:
MarkParker5
2020-11-23 02:25:18 +02:00
parent 9c609c2ff4
commit 33ec5d6586
2 changed files with 40 additions and 0 deletions

39
SmartHome/window.py Normal file
View File

@ -0,0 +1,39 @@
from .SmartHome import *
################################################################################
def method(params):
SmartHome.send({
'target': 'window',
'cmd': 'window_open',
})
voice = text = ''
return {
'type': 'simple',
'text': text,
'voice': voice,
}
keywords = {}
patterns = ['* (открыть|открой) (окно|окна) *', '* (подними|поднять) (шторы|роллеты) *']
window_open = SmartHome('window_open', keywords, patterns)
window_open.setStart(method)
################################################################################
def method(params):
SmartHome.send({
'target': 'window',
'cmd': 'window_close',
})
voice = text = ''
return {
'type': 'simple',
'text': text,
'voice': voice,
}
keywords = {}
patterns = ['* (закрыть|закрой) (окно|окна) *', '* (опусти|опустить) (шторы|роллеты) *']
window_close = SmartHome('window_close', keywords, patterns)
window_close.setStart(method)