From 4122d7d1883d1f1b70f54f14e41ba73046e827b6 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 22 Jan 2020 00:28:53 -0500 Subject: [PATCH 1/5] add power readings to ac_config --- example.py | 2 ++ wideq/ac.py | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/example.py b/example.py index 05d9b65..0607918 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_inout_instant_power()) + print(ac.get_out_total_instant_power()) print(ac.get_volume()) print(ac.get_light()) print(ac.get_zones()) diff --git a/wideq/ac.py b/wideq/ac.py index a9afaf5..0a643f1 100644 --- a/wideq/ac.py +++ b/wideq/ac.py @@ -249,6 +249,16 @@ class ACDevice(Device): return self._get_config('EnergyDesiredValue') + def get_inout_instant_power(self): + """Get the instant power consumption.""" + + return self._get_config('InOutInstantPower') + + def get_out_total_instant_power(self): + """Get the OutTotalInstantPower value (not sure what that is)""" + + return self._get_config('OutTotalInstantPower') + def get_light(self): """Get a Boolean indicating whether the display light is on.""" From 5bc145f94acd53f0c5102a2850be962b24196aae Mon Sep 17 00:00:00 2001 From: David Date: Wed, 22 Jan 2020 11:49:17 -0500 Subject: [PATCH 2/5] add __pycache__ to ignore list --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ca4300b..b3cde95 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .tox dist/ wideq_state.json +wideq/__pycache__ \ No newline at end of file From 7b7f1e76f6290b90d5a9ca9131d18400afe7b547 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 22 Jan 2020 12:17:36 -0500 Subject: [PATCH 3/5] change power usage names and added units --- example.py | 4 ++-- wideq/ac.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/example.py b/example.py index 0607918..b193b1b 100755 --- a/example.py +++ b/example.py @@ -146,8 +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_inout_instant_power()) - print(ac.get_out_total_instant_power()) + 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 0a643f1..0b8363b 100644 --- a/wideq/ac.py +++ b/wideq/ac.py @@ -249,13 +249,13 @@ class ACDevice(Device): return self._get_config('EnergyDesiredValue') - def get_inout_instant_power(self): - """Get the instant power consumption.""" + def get_outdoor_power(self): + """Get instant power usage in watts of the outdoor unit""" return self._get_config('InOutInstantPower') - def get_out_total_instant_power(self): - """Get the OutTotalInstantPower value (not sure what that is)""" + def get_power(self): + """Get the instant power usage in watts of the whole unit""" return self._get_config('OutTotalInstantPower') From 08bb4ca9426c519593986856cdea060cb12770cf Mon Sep 17 00:00:00 2001 From: David Date: Wed, 22 Jan 2020 12:43:53 -0500 Subject: [PATCH 4/5] fix to return just the power integer value --- wideq/ac.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wideq/ac.py b/wideq/ac.py index 0b8363b..93ccb6a 100644 --- a/wideq/ac.py +++ b/wideq/ac.py @@ -252,12 +252,14 @@ class ACDevice(Device): def get_outdoor_power(self): """Get instant power usage in watts of the outdoor unit""" - return self._get_config('InOutInstantPower') + value = self._get_config('OutTotalInstantPower') + return value['OutTotalInstantPower'] def get_power(self): """Get the instant power usage in watts of the whole unit""" - return self._get_config('OutTotalInstantPower') + value = self._get_config('InOutInstantPower') + return value['InOutInstantPower'] def get_light(self): """Get a Boolean indicating whether the display light is on.""" From 8aa8449f5bf8ab1d18e73872e5f76fc0fb13f0ba Mon Sep 17 00:00:00 2001 From: David Date: Wed, 22 Jan 2020 12:49:40 -0500 Subject: [PATCH 5/5] update to ignore __pycache__ wherever it appears --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b3cde95..61b11f1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ .tox dist/ wideq_state.json -wideq/__pycache__ \ No newline at end of file +__pycache__ \ No newline at end of file