Skip to content

Commit 1dfcb60

Browse files
authored
fix: return hard limit if max_current_soft higher than hard limit (#423)
* fix: return hard limit if max_current_soft higher than hard limit * use min() function
1 parent 9588370 commit 1dfcb60

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

openevsehttp/__main__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,9 @@ async def async_charge_current(self) -> int | None:
959959
except UnsupportedFeature:
960960
pass
961961
if claims is not None and "charge_current" in claims["properties"].keys():
962-
return claims["properties"]["charge_current"]
962+
return min(
963+
claims["properties"]["charge_current"], self._config["max_current_hard"]
964+
)
963965
if self._config is not None and "max_current_soft" in self._config:
964966
return self._config["max_current_soft"]
965967
return self._status["pilot"]

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
PROJECT_DIR = Path(__file__).parent.resolve()
88
README_FILE = PROJECT_DIR / "README.md"
9-
VERSION = "0.1.78"
9+
VERSION = "0.1.79"
1010

1111
setup(
1212
name="python_openevse_http",

0 commit comments

Comments
 (0)