-
Notifications
You must be signed in to change notification settings - Fork 10
/
example.py
36 lines (28 loc) · 954 Bytes
/
example.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
from JciHitachi.api import JciHitachiAWSAPI
# Fill out your Jci Hitachi email address, password, and device name.
EMAIL = "[email protected]"
PASSWORD = "password"
DEVICENAME = "living room"
def main():
# Login
api = JciHitachiAWSAPI(EMAIL, PASSWORD, DEVICENAME)
api.login()
# Check device status
# device_status = api.get_status(legacy=True) # return legacy status class
device_status = api.get_status()
print(device_status[DEVICENAME].status)
# Set device status
# For available command names and values, please refer to
# model.py->STATUS_DICT
if api.set_status(
status_name="TemperatureSetting", device_name=DEVICENAME, status_value=27
):
print("Success")
else:
print("Failed")
# Check the updated device status
api.refresh_status()
device_status = api.get_status()
print(device_status[DEVICENAME].status)
if __name__ == "__main__":
main()