-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
52 lines (40 loc) · 1.26 KB
/
Copy pathmain.py
File metadata and controls
52 lines (40 loc) · 1.26 KB
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
# Importing files + workspaces
import constants
import functions
from hubspace import Hubspace
# Logging into hubspace
hubspace = Hubspace(constants.login.username, constants.login.password)
# Collects the device names and IDs and puts them into an array.
my_devices = {}
devices = hubspace.getDevices()
print(hubspace.getDevices()[0].getAttributes())
for device in devices:
my_devices[device.getName()] = hubspace.getDevice(device.getID())
# Removes first device and its ID because it is not a valid device.
del my_devices[""]
print("Welcome to Jackson's Hubspace Lighting!")
while (True):
command = input(constants.prompts.init)
print(hubspace.getDevices()[0].getAttributes())
"""
if command == "1":
value = input(constants.prompts.state)
functions.state(value, my_devices)
elif command == "2":
value = input(constants.prompts.brightness)
functions.brightness(value, my_devices)
elif command == "3":
value = input(constants.prompts.color)
functions.color(value, my_devices)
elif command == "4":
value = input(constants.prompts.warmth)
try:
functions.warmth(constants.values[value], my_devices)
except:
functions.error()
elif command == "exit":
print("Goodbye!")
exit(0)
else:
functions.error
"""