-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.py
88 lines (73 loc) · 2.55 KB
/
api.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
"""First hug API (local and HTTP access)"""
import hug
from fritzAHA import FritzDect
@hug.get('/GetSwitchList')
@hug.local()
def GetSwitchList(username, password, url=None):
fritz = FritzDect()
return fritz.GetSwitchList(username, password, url)
@hug.get('/SetSwitchOn')
@hug.local()
def SetSwitchOn(username, password, ain, url=None):
fritz = FritzDect()
return fritz.SetSwitchOn(username, password,ain, url)
@hug.get('/SetSwitchOff')
@hug.local()
def SetSwitchOff(username, password, ain, url=None):
fritz = FritzDect()
return fritz.SetSwitchOff(username, password,ain, url)
@hug.get('/SetSwitchToggle')
@hug.local()
def SetSwitchToggle(username, password, ain, url=None):
fritz = FritzDect()
return fritz.SetSwitchToggle(username, password,ain, url)
@hug.get('/GetSwitchState')
@hug.local()
def GetSwitchState(username, password, ain, url=None):
fritz = FritzDect()
return fritz.GetSwitchState(username, password,ain, url)
@hug.get('/GetSwitchPresent')
@hug.local()
def GetSwitchPresent(username, password, ain, url=None):
fritz = FritzDect()
return fritz.GetSwitchPresent(username, password,ain, url)
@hug.get('/GetSwitchPower')
@hug.local()
def GetSwitchPower(username, password, ain, url=None):
fritz = FritzDect()
return fritz.GetSwitchPower(username, password,ain, url)
@hug.get('/GetSwitchEnergy')
@hug.local()
def GetSwitchEnergy(username, password, ain, url=None):
fritz = FritzDect()
return fritz.GetSwitchEnergy(username, password,ain, url)
@hug.get('/GetSwitchName')
@hug.local()
def GetSwitchName(username, password, ain, url=None):
fritz = FritzDect()
return fritz.GetSwitchName(username, password,ain, url)
@hug.get('/GetDeviceListInfos')
@hug.local()
def GetDeviceListInfos(username, password, url=None):
fritz = FritzDect()
return fritz.GetDeviceListInfos(username, password, url)
@hug.get('/GetTemperature')
@hug.local()
def GetTemperature(username, password, ain, url=None):
fritz = FritzDect()
return fritz.GetTemperature(username, password,ain, url)
@hug.get('/GetHkrtSoll')
@hug.local()
def GetHkrtSoll(username, password, ain, url=None):
fritz = FritzDect()
return fritz.GetHkrtSoll(username, password,ain, url)
@hug.get('/GetHkrKomfort')
@hug.local()
def GetHkrKomfort(username, password, ain, url=None):
fritz = FritzDect()
return fritz.GetHkrKomfort(username, password,ain, url)
@hug.get('/SetHkrtSoll')
@hug.local()
def SetHkrtSoll(username, password, ain, url=None):
fritz = FritzDect()
return fritz.SetHkrtSoll(username, password,ain, url)