This commit is contained in:
Kai Wansart
2018-02-02 00:21:59 +01:00
commit 9c3e560900
36 changed files with 1114 additions and 0 deletions

25
app/devices/denon.py Normal file
View File

@ -0,0 +1,25 @@
import denonavr
##---------------------------------------------------------------------------------------##
class Denon(object):
##---------------------------------------------------------------------------------------##
##-----------------------------------------------------------------------------------##
def __init__(self, device):
##-----------------------------------------------------------------------------------##
self.device = denonavr.DenonAVR(device['ip'])
##-----------------------------------------------------------------------------------##
def power(self, state=None):
##-----------------------------------------------------------------------------------##
if(state==None):
return -1
if(state=="on"):
self.device.power_on()
else:
self.device.power_off()
##-----------------------------------------------------------------------------------##
def setInput(self, input):
##-----------------------------------------------------------------------------------##
self.device.input_func = input