2020-11-28 07:14:25 +02:00
|
|
|
from .Raspi import *
|
|
|
|
################################################################################
|
|
|
|
def method(params):
|
|
|
|
Raspi.hdmi_cec('on 0')
|
|
|
|
Raspi.hdmi_cec('as')
|
|
|
|
voice = text = ''
|
|
|
|
return {
|
|
|
|
'type': 'simple',
|
|
|
|
'text': text,
|
|
|
|
'voice': voice,
|
|
|
|
}
|
|
|
|
|
|
|
|
keywords = {}
|
|
|
|
patterns = ['* включи* (телевизор|экран) *']
|
|
|
|
tv_on = Raspi('tv on', keywords, patterns)
|
|
|
|
tv_on.setStart(method)
|
|
|
|
################################################################################
|
|
|
|
def method(params):
|
|
|
|
Raspi.hdmi_cec('standby 0')
|
|
|
|
voice = text = ''
|
|
|
|
return {
|
|
|
|
'type': 'simple',
|
|
|
|
'text': text,
|
|
|
|
'voice': voice,
|
|
|
|
}
|
|
|
|
|
|
|
|
keywords = {}
|
|
|
|
patterns = ['* (выключи|отключи)* (телевизор|экран) *']
|
|
|
|
tv_off = Raspi('tv off', keywords, patterns)
|
|
|
|
tv_off.setStart(method)
|
|
|
|
################################################################################
|
|
|
|
def method(params):
|
2020-11-28 08:36:59 +02:00
|
|
|
port = params['num'] + '0' if len(params['num']) == 1 else params['num']
|
|
|
|
Raspi.hdmi_cec(f'tx 4F:82:{port}:00')
|
2020-11-28 07:14:25 +02:00
|
|
|
voice = text = ''
|
|
|
|
return {
|
|
|
|
'type': 'simple',
|
|
|
|
'text': text,
|
|
|
|
'voice': voice,
|
|
|
|
}
|
|
|
|
|
|
|
|
keywords = {}
|
2020-11-28 08:36:59 +02:00
|
|
|
patterns = ['* (выведи|вывести|покажи|открой|показать|открыть) * с (|провода|hdmi|кабеля|порта) * $num *']
|
2020-11-28 07:14:25 +02:00
|
|
|
tv_hdmi = Raspi('tv hdmi source', keywords, patterns)
|
|
|
|
tv_hdmi.setStart(method)
|
|
|
|
################################################################################
|
2020-11-28 08:34:19 +02:00
|
|
|
def method(params):
|
2020-11-28 08:36:59 +02:00
|
|
|
Raspi.hdmi_cec('tx 4F:82:20:00')
|
2020-11-28 08:34:19 +02:00
|
|
|
voice = text = ''
|
|
|
|
return {
|
|
|
|
'type': 'simple',
|
|
|
|
'text': text,
|
|
|
|
'voice': voice,
|
|
|
|
}
|
|
|
|
|
|
|
|
keywords = {}
|
2020-11-28 08:36:59 +02:00
|
|
|
patterns = ['* (выведи|вывести|покажи|открой|показать|открыть) * с (ноута|ноутбука|провода|hdmi)']
|
2020-11-28 08:34:19 +02:00
|
|
|
tv_hdmi = Raspi('tv hdmi source', keywords, patterns)
|
|
|
|
tv_hdmi.setStart(method)
|
|
|
|
################################################################################
|
2020-11-28 07:14:25 +02:00
|
|
|
def method(params):
|
|
|
|
Raspi.hdmi_cec('as')
|
|
|
|
voice = text = ''
|
|
|
|
return {
|
|
|
|
'type': 'simple',
|
|
|
|
'text': text,
|
|
|
|
'voice': voice,
|
|
|
|
}
|
|
|
|
|
|
|
|
keywords = {}
|
|
|
|
patterns = ['* (верни|вернуть|включи*|покажи|показать) [нормальн|стандартн|привычн]* (телевизор|экран|картинк|изображение) *']
|
|
|
|
tv_rpi = Raspi('tv rpi source', keywords, patterns)
|
|
|
|
tv_rpi.setStart(method)
|