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:
parent
bb5aa17c0f
commit
07b6a1ca21
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user