python-siseli 0.2.5__tar.gz → 0.2.6__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 (43) hide show
  1. {python_siseli-0.2.5 → python_siseli-0.2.6}/PKG-INFO +1 -1
  2. {python_siseli-0.2.5 → python_siseli-0.2.6}/pyproject.toml +1 -1
  3. {python_siseli-0.2.5 → python_siseli-0.2.6}/python_siseli.egg-info/PKG-INFO +1 -1
  4. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/config.py +3 -2
  5. {python_siseli-0.2.5 → python_siseli-0.2.6}/tests/test_phase3.py +35 -0
  6. {python_siseli-0.2.5 → python_siseli-0.2.6}/README.md +0 -0
  7. {python_siseli-0.2.5 → python_siseli-0.2.6}/python_siseli.egg-info/SOURCES.txt +0 -0
  8. {python_siseli-0.2.5 → python_siseli-0.2.6}/python_siseli.egg-info/dependency_links.txt +0 -0
  9. {python_siseli-0.2.5 → python_siseli-0.2.6}/python_siseli.egg-info/requires.txt +0 -0
  10. {python_siseli-0.2.5 → python_siseli-0.2.6}/python_siseli.egg-info/top_level.txt +0 -0
  11. {python_siseli-0.2.5 → python_siseli-0.2.6}/setup.cfg +0 -0
  12. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/__init__.py +0 -0
  13. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/_utils.py +0 -0
  14. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/alarms.py +0 -0
  15. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/auth.py +0 -0
  16. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/client.py +0 -0
  17. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/config_safety.py +0 -0
  18. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/const.py +0 -0
  19. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/dashboard.py +0 -0
  20. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/device.py +0 -0
  21. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/dictionary.py +0 -0
  22. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/exceptions.py +0 -0
  23. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/history.py +0 -0
  24. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/models/__init__.py +0 -0
  25. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/models/alarm.py +0 -0
  26. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/models/auth.py +0 -0
  27. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/models/common.py +0 -0
  28. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/models/config.py +0 -0
  29. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/models/dashboard.py +0 -0
  30. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/models/device.py +0 -0
  31. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/models/dictionary.py +0 -0
  32. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/models/history.py +0 -0
  33. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/models/state.py +0 -0
  34. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/models/station.py +0 -0
  35. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/open_auth.py +0 -0
  36. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/overview.py +0 -0
  37. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/state.py +0 -0
  38. {python_siseli-0.2.5 → python_siseli-0.2.6}/siseli/station.py +0 -0
  39. {python_siseli-0.2.5 → python_siseli-0.2.6}/tests/test_auth.py +0 -0
  40. {python_siseli-0.2.5 → python_siseli-0.2.6}/tests/test_config_safety.py +0 -0
  41. {python_siseli-0.2.5 → python_siseli-0.2.6}/tests/test_normalized_telemetry.py +0 -0
  42. {python_siseli-0.2.5 → python_siseli-0.2.6}/tests/test_open_auth.py +0 -0
  43. {python_siseli-0.2.5 → python_siseli-0.2.6}/tests/test_overview.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-siseli
3
- Version: 0.2.5
3
+ Version: 0.2.6
4
4
  Summary: Python SDK for Siseli Cloud
5
5
  License: MIT
6
6
  Requires-Python: >=3.11
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-siseli"
7
- version = "0.2.5"
7
+ version = "0.2.6"
8
8
  description = "Python SDK for Siseli Cloud"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-siseli
3
- Version: 0.2.5
3
+ Version: 0.2.6
4
4
  Summary: Python SDK for Siseli Cloud
5
5
  License: MIT
6
6
  Requires-Python: >=3.11
@@ -65,7 +65,7 @@ async def fetch_device_config(
65
65
  "POST",
66
66
  "/apis/remote/device/config/read",
67
67
  params={"deviceId": device_id},
68
- json={"id": config_id, "key": key},
68
+ json={"id": config_id or device_id, "key": key},
69
69
  )
70
70
  return _parse_attribute_metadata(data, key)
71
71
 
@@ -86,7 +86,7 @@ async def write_device_config(
86
86
  "POST",
87
87
  "/apis/remote/device/config/write",
88
88
  params={"deviceId": device_id},
89
- json={"id": config_id, "key": key, "value": value},
89
+ json={"id": config_id or device_id, "key": key, "value": value},
90
90
  )
91
91
  if data is None:
92
92
  return None
@@ -104,6 +104,7 @@ async def fetch_cached_device_configs(
104
104
  "POST",
105
105
  "/apis/remote/device/configs/cache/get",
106
106
  params={"deviceId": device_id},
107
+ json={"id": device_id},
107
108
  )
108
109
  return _parse_config_map(data)
109
110
 
@@ -7,6 +7,7 @@ import pytest
7
7
  from siseli.alarms import fetch_alarm_list, fetch_latest_alarm
8
8
  from siseli.config import (
9
9
  fetch_cached_device_configs,
10
+ fetch_device_config,
10
11
  fetch_device_configs,
11
12
  write_device_config,
12
13
  )
@@ -158,6 +159,40 @@ async def test_fetch_config_cache_parses_metadata() -> None:
158
159
  assert updated.is_writable_config_attribute is True
159
160
 
160
161
 
162
+ @pytest.mark.asyncio
163
+ async def test_config_read_requests_include_expected_json_bodies() -> None:
164
+ calls: list[tuple[str, str, dict]] = []
165
+
166
+ async def request(method: str, path: str, **kwargs):
167
+ calls.append((method, path, kwargs))
168
+ if path.endswith("/configs/cache/get"):
169
+ return {}
170
+ return {
171
+ "key": "buzzerEnabled",
172
+ "name": "Buzzer Enabled",
173
+ "nameDisplay": "Buzzer Enabled",
174
+ "valueType": 2,
175
+ "value": 0,
176
+ }
177
+
178
+ await fetch_cached_device_configs(request, "device-1")
179
+ await fetch_device_config(request, "device-1", key="buzzerEnabled")
180
+
181
+ assert calls[0] == (
182
+ "POST",
183
+ "/apis/remote/device/configs/cache/get",
184
+ {"params": {"deviceId": "device-1"}, "json": {"id": "device-1"}},
185
+ )
186
+ assert calls[1] == (
187
+ "POST",
188
+ "/apis/remote/device/config/read",
189
+ {
190
+ "params": {"deviceId": "device-1"},
191
+ "json": {"id": "device-1", "key": "buzzerEnabled"},
192
+ },
193
+ )
194
+
195
+
161
196
  @pytest.mark.asyncio
162
197
  async def test_fetch_station_data_parses_flow_and_summary() -> None:
163
198
  async def request(method: str, path: str, **kwargs):
File without changes
File without changes