-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.tv.py
64 lines (45 loc) · 1.27 KB
/
example.tv.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from classes.clientwrapper import ClientWrapper
from classes.things import TV
from credentials import appKey,secretKey
from credentials import thing_1
'''
Implemented functions for TV
'''
def tv_powerState(arg):
print("tv_powerState=",arg)
return True,arg[0]
def tv_setVolume(arg):
print("tv_setVolume=",arg)
return True, arg[0]
def tv_adjustVolume(arg):
print("tv_adjustVolume=",arg)
return True, arg[0]
def tv_setMute(arg):
print("tv_setMute=",arg)
return True, arg[0]
def tv_mediaControl(arg):
print("tv_mediaControl=",arg)
return True, arg[0]
def tv_selectInput(arg):
print("tv_selectInput=",arg)
return True, arg[0]
def tv_changeChannel(arg):
print("tv_changeChannel=",arg)
return True, arg[0]
def tv_skipChannels(arg):
print("tv_skipChannels=",arg)
return True, arg[0]
if __name__ == '__main__':
tv = TV(thing_1)
tv.powerState(tv_powerState)
tv.setVolume(tv_setVolume)
tv.adjustVolume(tv_adjustVolume)
tv.setMute(tv_setMute)
tv.mediaControl(tv_mediaControl)
tv.selectInput(tv_selectInput)
tv.changeChannel(tv_changeChannel)
tv.skipChannels(tv_skipChannels)
devices = [tv]
wrap = ClientWrapper(devices, appKey, secretKey)
# Do some stuff ...
wrap.start()