25 lines
1.1 KiB
Python
25 lines
1.1 KiB
Python
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 |