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.
Files changed (54) hide show
  1. {podpointclient-2.0.0 → podpointclient-2.0.1}/PKG-INFO +1 -1
  2. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/pod.py +10 -5
  3. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/version.py +1 -1
  4. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient.egg-info/PKG-INFO +1 -1
  5. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient.egg-info/SOURCES.txt +1 -0
  6. podpointclient-2.0.1/tests/test_firmware_camel_case.py +16 -0
  7. {podpointclient-2.0.0 → podpointclient-2.0.1}/LICENSE +0 -0
  8. {podpointclient-2.0.0 → podpointclient-2.0.1}/README.md +0 -0
  9. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/__init__.py +0 -0
  10. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/charge.py +0 -0
  11. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/charge_mode.py +0 -0
  12. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/charge_override.py +0 -0
  13. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/client.py +0 -0
  14. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/connectivity_status.py +0 -0
  15. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/endpoints.py +0 -0
  16. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/errors.py +0 -0
  17. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/factories.py +0 -0
  18. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/helpers/__init__.py +0 -0
  19. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/helpers/api_wrapper.py +0 -0
  20. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/helpers/auth.py +0 -0
  21. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/helpers/enums.py +0 -0
  22. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/helpers/functions.py +0 -0
  23. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/helpers/redact.py +0 -0
  24. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/helpers/session.py +0 -0
  25. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/py.typed +0 -0
  26. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/schedule.py +0 -0
  27. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient/user.py +0 -0
  28. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient.egg-info/dependency_links.txt +0 -0
  29. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient.egg-info/requires.txt +0 -0
  30. {podpointclient-2.0.0 → podpointclient-2.0.1}/podpointclient.egg-info/top_level.txt +0 -0
  31. {podpointclient-2.0.0 → podpointclient-2.0.1}/pyproject.toml +0 -0
  32. {podpointclient-2.0.0 → podpointclient-2.0.1}/setup.cfg +0 -0
  33. {podpointclient-2.0.0 → podpointclient-2.0.1}/setup.py +0 -0
  34. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_api_wrapper.py +0 -0
  35. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_auth.py +0 -0
  36. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_charge.py +0 -0
  37. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_charge_factory.py +0 -0
  38. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_charge_override.py +0 -0
  39. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_client.py +0 -0
  40. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_connectivity_status.py +0 -0
  41. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_connectivity_status_factory.py +0 -0
  42. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_documentation.py +0 -0
  43. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_enums.py +0 -0
  44. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_firmware.py +0 -0
  45. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_firmware_factory.py +0 -0
  46. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_helpers.py +0 -0
  47. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_pod.py +0 -0
  48. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_pod_factory.py +0 -0
  49. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_redact.py +0 -0
  50. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_schedule.py +0 -0
  51. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_session.py +0 -0
  52. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_user.py +0 -0
  53. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_user_factory.py +0 -0
  54. {podpointclient-2.0.0 → podpointclient-2.0.1}/tests/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: podpointclient
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: A simple API client for Pod Point (https://pod-point.com) aimed at home users
5
5
  Home-page: https://github.com/mattrayner/podpointclient
6
6
  Author: Matthew Rayner
@@ -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
- self.serial_number: Optional[str] = data.get('serial_number', None)
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', None)
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('manifest_id', None)
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', None)
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('is_update_available', None)
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
@@ -1,3 +1,3 @@
1
1
  """Version for the podpointclient library"""
2
2
 
3
- __version__ = "2.0.0"
3
+ __version__ = "2.0.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: podpointclient
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: A simple API client for Pod Point (https://pod-point.com) aimed at home users
5
5
  Home-page: https://github.com/mattrayner/podpointclient
6
6
  Author: Matthew Rayner
@@ -39,6 +39,7 @@ tests/test_connectivity_status_factory.py
39
39
  tests/test_documentation.py
40
40
  tests/test_enums.py
41
41
  tests/test_firmware.py
42
+ tests/test_firmware_camel_case.py
42
43
  tests/test_firmware_factory.py
43
44
  tests/test_helpers.py
44
45
  tests/test_pod.py
@@ -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