mirror of
https://github.com/no2chem/wideq.git
synced 2025-05-16 15:20: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:
|
try:
|
||||||
ac.monitor_start()
|
ac.monitor_start()
|
||||||
|
except wideq.core.NotConnectedError:
|
||||||
|
print('Device not available.')
|
||||||
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
while True:
|
while True:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
state = ac.poll()
|
state = ac.poll()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user