python-chargepoint 1.9.2__tar.gz → 1.10.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_chargepoint-1.9.2 → python_chargepoint-1.10.0}/PKG-INFO +4 -3
- {python_chargepoint-1.9.2 → python_chargepoint-1.10.0}/pyproject.toml +5 -5
- {python_chargepoint-1.9.2 → python_chargepoint-1.10.0}/python_chargepoint/client.py +35 -4
- {python_chargepoint-1.9.2 → python_chargepoint-1.10.0}/python_chargepoint/types.py +6 -2
- {python_chargepoint-1.9.2 → python_chargepoint-1.10.0}/LICENSE +0 -0
- {python_chargepoint-1.9.2 → python_chargepoint-1.10.0}/README.md +0 -0
- {python_chargepoint-1.9.2 → python_chargepoint-1.10.0}/python_chargepoint/__init__.py +0 -0
- {python_chargepoint-1.9.2 → python_chargepoint-1.10.0}/python_chargepoint/__main__.py +0 -0
- {python_chargepoint-1.9.2 → python_chargepoint-1.10.0}/python_chargepoint/constants.py +0 -0
- {python_chargepoint-1.9.2 → python_chargepoint-1.10.0}/python_chargepoint/exceptions.py +0 -0
- {python_chargepoint-1.9.2 → python_chargepoint-1.10.0}/python_chargepoint/global_config.py +0 -0
- {python_chargepoint-1.9.2 → python_chargepoint-1.10.0}/python_chargepoint/session.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: python-chargepoint
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.10.0
|
|
4
4
|
Summary: A simple, Pythonic wrapper for the ChargePoint API.
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Marc Billow
|
|
@@ -12,7 +12,8 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
-
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
|
16
17
|
Description-Content-Type: text/markdown
|
|
17
18
|
|
|
18
19
|
# python-chargepoint
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "python-chargepoint"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.10.0"
|
|
4
4
|
description = "A simple, Pythonic wrapper for the ChargePoint API."
|
|
5
5
|
authors = ["Marc Billow <mbillow@users.noreply.github.compoetry>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -11,14 +11,14 @@ readme = "README.md"
|
|
|
11
11
|
|
|
12
12
|
[tool.poetry.dependencies]
|
|
13
13
|
python = "^3.9"
|
|
14
|
-
requests = "^2.
|
|
14
|
+
requests = "^2.32.3"
|
|
15
15
|
|
|
16
|
-
[tool.poetry.dev
|
|
16
|
+
[tool.poetry.group.dev.dependencies]
|
|
17
17
|
tox = "^3.24.5"
|
|
18
|
-
black = "^
|
|
18
|
+
black = "^25.1.0"
|
|
19
19
|
pytest = "^6.2.5"
|
|
20
20
|
responses = "^0.18.0"
|
|
21
|
-
flake8 = "^
|
|
21
|
+
flake8 = "^7.2.0"
|
|
22
22
|
pytest-mock = "^3.7.0"
|
|
23
23
|
pytest-cov = "^3.0.0"
|
|
24
24
|
|
|
@@ -359,12 +359,17 @@ class ChargePoint:
|
|
|
359
359
|
return UserChargingStatus.from_json(status["user_status"])
|
|
360
360
|
|
|
361
361
|
@_require_login
|
|
362
|
-
def set_amperage_limit(
|
|
362
|
+
def set_amperage_limit(
|
|
363
|
+
self, charger_id: int, amperage_limit: int, max_retry: int = 5
|
|
364
|
+
) -> None:
|
|
363
365
|
_LOGGER.debug(f"Setting amperage limit for {charger_id} to {amperage_limit}")
|
|
364
|
-
request = {
|
|
366
|
+
request = {
|
|
367
|
+
"deviceData": self._device_data,
|
|
368
|
+
"chargeAmperageLimit": amperage_limit,
|
|
369
|
+
}
|
|
365
370
|
response = self._session.post(
|
|
366
371
|
f"{self._global_config.endpoints.internal_api}/driver/charger/{charger_id}/config/v1/charge-amperage-limit",
|
|
367
|
-
json=request
|
|
372
|
+
json=request,
|
|
368
373
|
)
|
|
369
374
|
|
|
370
375
|
if response.status_code != codes.ok:
|
|
@@ -397,9 +402,35 @@ class ChargePoint:
|
|
|
397
402
|
sleep(1)
|
|
398
403
|
|
|
399
404
|
raise ChargePointCommunicationException(
|
|
400
|
-
response=response,
|
|
405
|
+
response=response,
|
|
406
|
+
message="New amperage limit did not persist to charger after retries",
|
|
407
|
+
)
|
|
408
|
+
|
|
409
|
+
@_require_login
|
|
410
|
+
def restart_home_charger(self, charger_id: int) -> None:
|
|
411
|
+
_LOGGER.debug("Sending restart command for panda: %s", charger_id)
|
|
412
|
+
restart = {
|
|
413
|
+
"user_id": self.user_id,
|
|
414
|
+
"restart_panda": {"device_id": charger_id, "mfhs": {}},
|
|
415
|
+
}
|
|
416
|
+
response = self._session.post(
|
|
417
|
+
f"{self._global_config.endpoints.webservices}mobileapi/v5", json=restart
|
|
401
418
|
)
|
|
402
419
|
|
|
420
|
+
if response.status_code != codes.ok:
|
|
421
|
+
_LOGGER.error(
|
|
422
|
+
"Failed to restart charger! status_code=%s err=%s",
|
|
423
|
+
response.status_code,
|
|
424
|
+
response.text,
|
|
425
|
+
)
|
|
426
|
+
raise ChargePointCommunicationException(
|
|
427
|
+
response=response, message="Failed to restart charger."
|
|
428
|
+
)
|
|
429
|
+
|
|
430
|
+
status = response.json()
|
|
431
|
+
_LOGGER.debug(status)
|
|
432
|
+
return
|
|
433
|
+
|
|
403
434
|
@_require_login
|
|
404
435
|
def get_charging_session(self, session_id: int) -> ChargingSession:
|
|
405
436
|
return ChargingSession(session_id=session_id, client=self)
|
|
@@ -120,8 +120,12 @@ class HomeChargerStatus:
|
|
|
120
120
|
reminder_time=json.get("plug_in_reminder_time", ""),
|
|
121
121
|
model=json.get("model", ""),
|
|
122
122
|
mac_address=json.get("mac_address", "00:00:00:00:00:00"),
|
|
123
|
-
amperage_limit=json.get("charge_amperage_setting", {}).get(
|
|
124
|
-
|
|
123
|
+
amperage_limit=json.get("charge_amperage_setting", {}).get(
|
|
124
|
+
"charge_limit", 0
|
|
125
|
+
),
|
|
126
|
+
possible_amperage_limits=json.get("charge_amperage_setting", {}).get(
|
|
127
|
+
"possible_charge_limit", 0
|
|
128
|
+
),
|
|
125
129
|
)
|
|
126
130
|
|
|
127
131
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|