-
Notifications
You must be signed in to change notification settings - Fork 9
/
legacy_example.py
29 lines (23 loc) · 750 Bytes
/
legacy_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
from JciHitachi.api import JciHitachiAPI
# Fill out your Jci Hitachi email address, password, and device name.
EMAIL = "yourname@yourdomain.com"
PASSWORD = "password"
DEVICENAME = "living room"
# Login
api = JciHitachiAPI(EMAIL, PASSWORD, DEVICENAME)
api.login()
# Check device status
device_status = api.get_status()
print(device_status[DEVICENAME].status)
# Set device status
# For available command names and values, please refer to
# Air conditioner: status.py->JciHitachiAC
# Dehumidifier: status.py->JciHitachiDH
if api.set_status("target_temp", 27, DEVICENAME):
print("Success")
else:
print("Failed")
# Check the updated device status
api.refresh_status()
device_status = api.get_status()
print(device_status[DEVICENAME].status)