diff --git a/.gitignore b/.gitignore index ca4300b..61b11f1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .tox dist/ wideq_state.json +__pycache__ \ No newline at end of file diff --git a/example.py b/example.py index 90f74c0..1cbb55c 100755 --- a/example.py +++ b/example.py @@ -146,6 +146,8 @@ def ac_config(client, device_id): print(ac.get_filter_state()) print(ac.get_mfilter_state()) print(ac.get_energy_target()) + print(ac.get_power(), " watts") + print(ac.get_outdoor_power(), " watts") print(ac.get_volume()) print(ac.get_light()) print(ac.get_zones()) diff --git a/wideq/ac.py b/wideq/ac.py index a9afaf5..93ccb6a 100644 --- a/wideq/ac.py +++ b/wideq/ac.py @@ -249,6 +249,18 @@ class ACDevice(Device): return self._get_config('EnergyDesiredValue') + def get_outdoor_power(self): + """Get instant power usage in watts of the outdoor unit""" + + value = self._get_config('OutTotalInstantPower') + return value['OutTotalInstantPower'] + + def get_power(self): + """Get the instant power usage in watts of the whole unit""" + + value = self._get_config('InOutInstantPower') + return value['InOutInstantPower'] + def get_light(self): """Get a Boolean indicating whether the display light is on."""