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

Handle NotConnectedError in example

This commit is contained in:
Adrian Sampson 2019-11-28 09:34:51 -05:00
parent bb5aa17c0f
commit 07b6a1ca21

View File

@ -79,6 +79,11 @@ def ac_mon(client, device_id):
try:
ac.monitor_start()
except wideq.core.NotConnectedError:
print('Device not available.')
return
try:
while True:
time.sleep(1)
state = ac.poll()