podpointclient 2.0.0__tar.gz → 2.0.1__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.
- {podpointclient-2.0.0 → podpointclient-2.0.1}/PKG-INFO +1 -1
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/pod.py +10 -5
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/version.py +1 -1
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient.egg-info/PKG-INFO +1 -1
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient.egg-info/SOURCES.txt +1 -0
- podpointclient-2.0.1/tests/test_firmware_camel_case.py +16 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/LICENSE +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/README.md +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/__init__.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/charge.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/charge_mode.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/charge_override.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/client.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/connectivity_status.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/endpoints.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/errors.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/factories.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/helpers/__init__.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/helpers/api_wrapper.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/helpers/auth.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/helpers/enums.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/helpers/functions.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/helpers/redact.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/helpers/session.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/py.typed +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/schedule.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/user.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient.egg-info/dependency_links.txt +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient.egg-info/requires.txt +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient.egg-info/top_level.txt +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/pyproject.toml +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/setup.cfg +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/setup.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_api_wrapper.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_auth.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_charge.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_charge_factory.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_charge_override.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_client.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_connectivity_status.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_connectivity_status_factory.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_documentation.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_enums.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_firmware.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_firmware_factory.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_helpers.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_pod.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_pod_factory.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_redact.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_schedule.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_session.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_user.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_user_factory.py +0 -0
- {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_version.py +0 -0
|
@@ -91,20 +91,25 @@ class FirmwareStatus:
|
|
|
91
91
|
class Firmware:
|
|
92
92
|
"""Representation of the pod's Firmware report"""
|
|
93
93
|
def __init__(self, data: Dict[str, Any]) -> None:
|
|
94
|
-
|
|
94
|
+
# Pod Point send camelCase names, older responses used snake_case
|
|
95
|
+
self.serial_number: Optional[str] = data.get('serialNumber') or data.get('serial_number')
|
|
95
96
|
self.version_info: Optional[FirmwareVersion] = None
|
|
96
97
|
self.update_status: Optional[FirmwareStatus] = None
|
|
97
98
|
|
|
98
|
-
firmware_version_data = data.get('version_info'
|
|
99
|
+
firmware_version_data = data.get('versionInfo') or data.get('version_info')
|
|
99
100
|
if firmware_version_data:
|
|
100
101
|
self.version_info = FirmwareVersion(
|
|
101
|
-
manifest_id=firmware_version_data.get('
|
|
102
|
+
manifest_id=firmware_version_data.get('manifestId')
|
|
103
|
+
or firmware_version_data.get('manifest_id')
|
|
102
104
|
)
|
|
103
105
|
|
|
104
|
-
update_status_data = data.get('update_status'
|
|
106
|
+
update_status_data = data.get('updateStatus') or data.get('update_status')
|
|
105
107
|
if update_status_data:
|
|
108
|
+
# False is a real value, so this cannot fall back with `or`
|
|
106
109
|
self.update_status = FirmwareStatus(
|
|
107
|
-
is_update_available=update_status_data.get(
|
|
110
|
+
is_update_available=update_status_data.get(
|
|
111
|
+
'isUpdateAvailable', update_status_data.get('is_update_available')
|
|
112
|
+
)
|
|
108
113
|
)
|
|
109
114
|
|
|
110
115
|
@property
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
|
|
3
|
+
from podpointclient.pod import Firmware
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@pytest.mark.parametrize("available", [True, False])
|
|
7
|
+
def test_camel_case_firmware(available):
|
|
8
|
+
firmware = Firmware(data={
|
|
9
|
+
"serialNumber": "123",
|
|
10
|
+
"versionInfo": {"architecture": "a", "details": {}, "manifestId": "A30P-1"},
|
|
11
|
+
"updateStatus": {"isUpdateAvailable": available},
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
assert firmware.serial_number == "123"
|
|
15
|
+
assert firmware.firmware_version == "A30P-1"
|
|
16
|
+
assert firmware.update_available is available
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|