Skip to content

Commit

Permalink
Merge pull request #35 from nanomad/master
Browse files Browse the repository at this point in the history
Powerboost configuration
  • Loading branch information
cliviu74 authored May 20, 2024
2 parents 60b18cf + c0982ba commit 9feaa91
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,6 @@ dmypy.json
test_liviu.py
APIDEBUG.md
.DS_Store

# PyCharm
.idea/
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ pip install wallbox
- a full charger reboot can take a few minutes. Charger status will be slow to update (ie: READY (10s) -> DISCONNECTED (90s) -> READY)
CAUTION: use this method with care!! Check if the charger is not in the middle of a firmware upgrade as this can brick your charger.


### setIcpMaxCurrent(chargerId, newIcpMaxCurrentValue)

- sets charger Maximum ICP Current available (Amps).

Please note that the wallbox may refuse this action if not setup properly of if not supported by your model


### getChargerSchedules(chargerId)

- gets the currently configured schedules for that charger.
Expand Down
27 changes: 8 additions & 19 deletions wallbox/wallbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,14 @@ def setEnergyCost(self, chargerId, energyCost):
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},

def getChargerSchedules(self, chargerId):
try:
response = requests.get(
Expand All @@ -213,25 +221,6 @@ def getChargerSchedules(self, chargerId):
raise (err)
return json.loads(response.text)

"""
Example request:
{
'schedules': [{
'id': 0,
'chargerId': 42,
'enable': 1,
'max_current': 1,
'max_energy': 0,
'days': {'friday': True, 'monday': True, 'saturday': True, 'sunday': True, 'thursday': True,
'tuesday': True, 'wednesday': True},
'start': '2100',
'stop': '0500'
}]
}
Where id is the position to add/replace
"""

def setChargerSchedules(self, chargerId, newSchedules):
try:
# Enforce chargerId
Expand Down

0 comments on commit 9feaa91

Please sign in to comment.