Skip to content

Commit 146b448

Browse files
authored
feat: expose max_current_soft
2 parents 9e30726 + f6c4c02 commit 146b448

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

openevsehttp/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,13 @@ def openevse_firmware(self) -> str:
682682
assert self._config is not None
683683
return self._config["firmware"]
684684

685+
@property
686+
def max_current_soft(self) -> int | None:
687+
"""Return the firmware version."""
688+
if self._config is not None and "max_current_soft" in self._config:
689+
return self._config["max_current_soft"]
690+
return None
691+
685692
@property
686693
def wifi_firmware(self) -> str:
687694
"""Return the ESP firmware version."""

tests/test_init.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,3 +900,14 @@ async def test_vehicle_eta(fixture, expected, request):
900900
await charger.update()
901901
status = charger.vehicle_eta
902902
assert status == expected
903+
904+
905+
@pytest.mark.parametrize(
906+
"fixture, expected", [("test_charger", 48), ("test_charger_v2", None)]
907+
)
908+
async def test_max_current_soft(fixture, expected, request):
909+
"""Test max_current_soft reply."""
910+
charger = request.getfixturevalue(fixture)
911+
await charger.update()
912+
status = charger.max_current_soft
913+
assert status == expected

0 commit comments

Comments
 (0)