From 59421a8cbd44bddefc1543d6713934bf15864ce4 Mon Sep 17 00:00:00 2001 From: Giovanni Condello Date: Thu, 11 Apr 2024 22:45:22 +0200 Subject: [PATCH] Allow power boost configuration Co-authored-by: @rubens73 (https://github.com/rubenms73) Fixes #32 --- wallbox/wallbox.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wallbox/wallbox.py b/wallbox/wallbox.py index 50091ee..97fa4cf 100644 --- a/wallbox/wallbox.py +++ b/wallbox/wallbox.py @@ -190,3 +190,15 @@ def setEnergyCost(self, chargerId, energyCost): except requests.exceptions.HTTPError as err: raise (err) return json.loads(response.text) + + def setIcpMaxCurrent(self, chargerId, newIcpMaxCurrentValue): + try: + response = requests.post( + f"{self.baseUrl}chargers/config/{chargerId}", + headers=self.headers, + json={'icp_max_current': newIcpMaxCurrentValue}, + ) + response.raise_for_status() + except requests.exceptions.HTTPError as err: + raise (err) + return json.loads(response.text)