mirror of
https://github.com/no2chem/wideq.git
synced 2025-05-21 09:30:13 -07:00
Run monitor loop indefinitely
This commit is contained in:
parent
336b7ec956
commit
29eb1804c5
@ -100,7 +100,8 @@ def example(args):
|
|||||||
device_id = args[1]
|
device_id = args[1]
|
||||||
|
|
||||||
with wideq.Monitor(session, device_id) as mon:
|
with wideq.Monitor(session, device_id) as mon:
|
||||||
for i in range(4):
|
try:
|
||||||
|
while True:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
print('Polling...')
|
print('Polling...')
|
||||||
res = mon.poll()
|
res = mon.poll()
|
||||||
@ -108,6 +109,9 @@ def example(args):
|
|||||||
print('setting: {}°C'.format(res['TempCfg']))
|
print('setting: {}°C'.format(res['TempCfg']))
|
||||||
print('current: {}°C'.format(res['TempCur']))
|
print('current: {}°C'.format(res['TempCur']))
|
||||||
|
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
pass
|
||||||
|
|
||||||
elif args[0] == 'set-temp':
|
elif args[0] == 'set-temp':
|
||||||
temp = args[1]
|
temp = args[1]
|
||||||
device_id = args[2]
|
device_id = args[2]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user