From 6d3e7b3fa616cc35e14f27cc840d2f6ae9ce916b Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 21 Apr 2018 14:59:53 -0400 Subject: [PATCH] Add method for reading light state --- example.py | 1 + wideq.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/example.py b/example.py index 21c10c0..112beb7 100644 --- a/example.py +++ b/example.py @@ -119,6 +119,7 @@ def ac_config(client, device_id): print(ac.get_filter_state()) print(ac.get_mfilter_state()) print(ac.get_energy_target()) + print(ac.get_light()) EXAMPLE_COMMANDS = { diff --git a/wideq.py b/wideq.py index 8ff5d24..0440b5c 100644 --- a/wideq.py +++ b/wideq.py @@ -833,6 +833,12 @@ class ACDevice(Device): return self._get_config('EnergyDesiredValue') + def get_light(self): + """Get a Boolean indicating whether the display light is on.""" + + value = self._get_control('DisplayControl') + return value == '(DisplayControl:0)' + def monitor_start(self): """Start monitoring the device's status."""