.
This commit is contained in:
25
app/devices/denon.py
Normal file
25
app/devices/denon.py
Normal 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
|
Reference in New Issue
Block a user