From 172750360b0f8052e27cd046342bce38f76ed43a Mon Sep 17 00:00:00 2001 From: Jose Carlos Garcia Sogo Date: Thu, 30 Dec 2021 09:51:44 +0100 Subject: [PATCH 1/4] Add manual_override and divertmode --- openevsehttp/__init__.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/openevsehttp/__init__.py b/openevsehttp/__init__.py index d0f1402..9e411c6 100644 --- a/openevsehttp/__init__.py +++ b/openevsehttp/__init__.py @@ -643,6 +643,22 @@ def ota_update(self) -> str: assert self._status is not None return self._status["ota_update"] + @property + def manual_override(self) -> str: + """Return if Manual Override is set.""" + assert self._status is not None + return self._status["manual_override"] + + @property + def divertmode(self) -> str: + """Return the divert mode.""" + assert self._status is not None + mode = self._status["divertmode"] + if mode == 1: + return "normal" + else: + return "eco" + # There is currently no min/max amps JSON data # available via HTTP API methods @property From c3f49b0ba02fead77a985fda8d623045880b5efd Mon Sep 17 00:00:00 2001 From: Jose Carlos Garcia Sogo Date: Thu, 30 Dec 2021 19:17:04 +0100 Subject: [PATCH 2/4] Add available_current, charge_rate and divert_active properties --- openevsehttp/__init__.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/openevsehttp/__init__.py b/openevsehttp/__init__.py index 9e411c6..b0717d3 100644 --- a/openevsehttp/__init__.py +++ b/openevsehttp/__init__.py @@ -659,6 +659,25 @@ def divertmode(self) -> str: else: return "eco" + @property + def available_current(self) -> float: + """Return the computed available current for divert.""" + assert self._status is not None + return self._status["available_current"] + + @property + def charge_rate(self) -> float: + """Return the divert charge rate.""" + assert self._status is not None + return self._status["charge_rate"] + + @property + def divert_active(self) -> bool: + """Return if divert is active""" + assert self._status is not None + return self._status["divert_active"] + + # There is currently no min/max amps JSON data # available via HTTP API methods @property From 8343060f0c8a78428dd1028d8bdef55177774905 Mon Sep 17 00:00:00 2001 From: Jose Carlos Garcia Sogo Date: Thu, 30 Dec 2021 19:32:01 +0100 Subject: [PATCH 3/4] Add smoothed_available_current --- openevsehttp/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openevsehttp/__init__.py b/openevsehttp/__init__.py index b0717d3..2f67767 100644 --- a/openevsehttp/__init__.py +++ b/openevsehttp/__init__.py @@ -665,6 +665,12 @@ def available_current(self) -> float: assert self._status is not None return self._status["available_current"] + @property + def smoothed_available_current(self) -> float: + """Return the computed smoothed available current for divert.""" + assert self._status is not None + return self._status["smoothed_available_current"] + @property def charge_rate(self) -> float: """Return the divert charge rate.""" From c28cfe5c91c951d29b9cf18c9b43f0111efbb4fa Mon Sep 17 00:00:00 2001 From: Jose Carlos Garcia Sogo Date: Thu, 30 Dec 2021 09:51:44 +0100 Subject: [PATCH 4/4] Add several additional properties - manual_override - divertmode - available_current - charge_rate - divert_active - smoothed_available_current --- openevsehttp/__init__.py | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/openevsehttp/__init__.py b/openevsehttp/__init__.py index d0f1402..2f67767 100644 --- a/openevsehttp/__init__.py +++ b/openevsehttp/__init__.py @@ -643,6 +643,47 @@ def ota_update(self) -> str: assert self._status is not None return self._status["ota_update"] + @property + def manual_override(self) -> str: + """Return if Manual Override is set.""" + assert self._status is not None + return self._status["manual_override"] + + @property + def divertmode(self) -> str: + """Return the divert mode.""" + assert self._status is not None + mode = self._status["divertmode"] + if mode == 1: + return "normal" + else: + return "eco" + + @property + def available_current(self) -> float: + """Return the computed available current for divert.""" + assert self._status is not None + return self._status["available_current"] + + @property + def smoothed_available_current(self) -> float: + """Return the computed smoothed available current for divert.""" + assert self._status is not None + return self._status["smoothed_available_current"] + + @property + def charge_rate(self) -> float: + """Return the divert charge rate.""" + assert self._status is not None + return self._status["charge_rate"] + + @property + def divert_active(self) -> bool: + """Return if divert is active""" + assert self._status is not None + return self._status["divert_active"] + + # There is currently no min/max amps JSON data # available via HTTP API methods @property