From 597895b2638c43d91bdc069ef1c81fd83966e4fe Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 21 Apr 2018 14:42:11 -0400 Subject: [PATCH] Expose AC config values I know of so far --- example.py | 8 ++++++++ wideq.py | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/example.py b/example.py index b7245d0..21c10c0 100644 --- a/example.py +++ b/example.py @@ -114,12 +114,20 @@ def turn(client, device_id, on_off): ac.set_on(on_off == 'on') +def ac_config(client, device_id): + ac = wideq.ACDevice(client, client.get_device(device_id)) + print(ac.get_filter_state()) + print(ac.get_mfilter_state()) + print(ac.get_energy_target()) + + EXAMPLE_COMMANDS = { 'ls': ls, 'mon': mon, 'ac-mon': ac_mon, 'set-temp': set_temp, 'turn': turn, + 'ac-config': ac_config, } diff --git a/wideq.py b/wideq.py index 0a0bbde..fe527f2 100644 --- a/wideq.py +++ b/wideq.py @@ -805,6 +805,22 @@ class ACDevice(Device): op_value = self.model.enum_value('Operation', op.value) self._set_control('Operation', op_value) + def get_filter_state(self): + """Get information about the filter.""" + + return self._get_config('Filter') + + def get_mfilter_state(self): + """Get information about the "MFilter" (not sure what this is). + """ + + return self._get_config('MFilter') + + def get_energy_target(self): + """Get the configured energy target data.""" + + return self._get_config('EnergyDesiredValue') + def monitor_start(self): """Start monitoring the device's status."""