mirror of
https://github.com/no2chem/wideq.git
synced 2025-05-21 01:20:11 -07:00
Run monitor loop indefinitely
This commit is contained in:
parent
336b7ec956
commit
29eb1804c5
18
example.py
18
example.py
@ -100,13 +100,17 @@ 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:
|
||||||
time.sleep(1)
|
while True:
|
||||||
print('Polling...')
|
time.sleep(1)
|
||||||
res = mon.poll()
|
print('Polling...')
|
||||||
if res:
|
res = mon.poll()
|
||||||
print('setting: {}°C'.format(res['TempCfg']))
|
if res:
|
||||||
print('current: {}°C'.format(res['TempCur']))
|
print('setting: {}°C'.format(res['TempCfg']))
|
||||||
|
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]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user