1
0
mirror of https://github.com/no2chem/wideq.git synced 2025-05-16 07:10:09 -07:00

Show how to check device type

This commit is contained in:
Adrian Sampson 2018-04-03 10:45:58 -04:00
parent c696489de2
commit fe77d66e96

View File

@ -70,7 +70,12 @@ def ac_mon(client, device_id):
its status such as its temperature and operation mode.
"""
ac = wideq.ACDevice(client, client.get_device(device_id))
device = client.get_device(device_id)
if device.type != wideq.DeviceType.AC:
print('This is not an AC device.')
return
ac = wideq.ACDevice(client, device)
try:
ac.monitor_start()