diff --git a/example.py b/example.py index b7ff729..44b520a 100644 --- a/example.py +++ b/example.py @@ -50,6 +50,26 @@ def example_command(client, args): except KeyboardInterrupt: pass + elif args[0] == 'ac-mon': + device_id = args[1] + ac = wideq.ACDevice(client, client.get_device(device_id)) + + try: + ac.monitor_start() + while True: + time.sleep(1) + state = ac.poll() + if state: + print( + 'cur {0.temp_cur_f}°F; cfg {0.temp_cfg_f}°F' + .format(state) + ) + + except KeyboardInterrupt: + pass + finally: + ac.monitor_stop() + elif args[0] == 'set-temp': temp = args[1] device_id = args[2] diff --git a/wideq.py b/wideq.py index 515d405..e92750f 100644 --- a/wideq.py +++ b/wideq.py @@ -625,6 +625,9 @@ class ACDevice(object): class ACStatus(object): + """Higher-level information about an AC device's current status. + """ + def __init__(self, ac, data): self.ac = ac self.data = data