python-siseli 0.2.4__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.
- {python_siseli-0.2.4 → python_siseli-0.2.6}/PKG-INFO +1 -1
- {python_siseli-0.2.4 → python_siseli-0.2.6}/pyproject.toml +1 -1
- {python_siseli-0.2.4 → python_siseli-0.2.6}/python_siseli.egg-info/PKG-INFO +1 -1
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/config.py +3 -2
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/config_safety.py +3 -7
- {python_siseli-0.2.4 → python_siseli-0.2.6}/tests/test_config_safety.py +4 -2
- {python_siseli-0.2.4 → python_siseli-0.2.6}/tests/test_phase3.py +35 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/README.md +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/python_siseli.egg-info/SOURCES.txt +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/python_siseli.egg-info/dependency_links.txt +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/python_siseli.egg-info/requires.txt +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/python_siseli.egg-info/top_level.txt +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/setup.cfg +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/__init__.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/_utils.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/alarms.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/auth.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/client.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/const.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/dashboard.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/device.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/dictionary.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/exceptions.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/history.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/models/__init__.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/models/alarm.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/models/auth.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/models/common.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/models/config.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/models/dashboard.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/models/device.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/models/dictionary.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/models/history.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/models/state.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/models/station.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/open_auth.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/overview.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/state.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/siseli/station.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/tests/test_auth.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/tests/test_normalized_telemetry.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/tests/test_open_auth.py +0 -0
- {python_siseli-0.2.4 → python_siseli-0.2.6}/tests/test_overview.py +0 -0
|
@@ -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
|
|
|
@@ -90,13 +90,9 @@ CONFIG_SPECS: dict[str, ConfigSpec] = {
|
|
|
90
90
|
ConfigSpec("overloadBypass", "Overload bypass", ConfigKind.ENUM, ConfigAccess.ADVANCED, _ON_OFF),
|
|
91
91
|
ConfigSpec("powerSavingEnable", "Power saving", ConfigKind.ENUM, ConfigAccess.ADVANCED, _ON_OFF),
|
|
92
92
|
ConfigSpec("setBatteryEqualizationEnable", "Battery equalization", ConfigKind.ENUM, ConfigAccess.ADVANCED, _ON_OFF),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
ConfigKind.ENUM,
|
|
97
|
-
ConfigAccess.ADVANCED,
|
|
98
|
-
{"0": "Utility first", "1": "Solar first", "2": "SBU"},
|
|
99
|
-
),
|
|
93
|
+
# settingDeviceOutputSourcePriority is intentionally absent: in the cloud,
|
|
94
|
+
# value 0 is displayed as "SUB" (SBU), which contradicts the PI30 order,
|
|
95
|
+
# and the full value mapping is not verified. Add it only once confirmed.
|
|
100
96
|
ConfigSpec(
|
|
101
97
|
"settingDeviceChargerPriority",
|
|
102
98
|
"Charger source priority",
|
|
@@ -75,8 +75,10 @@ def test_unsupported_key_rejected():
|
|
|
75
75
|
def test_access_levels():
|
|
76
76
|
assert validate_config_value("buzzerEnabled", True) == "1"
|
|
77
77
|
with pytest.raises(ConfigAccessDenied):
|
|
78
|
-
validate_config_value("
|
|
79
|
-
assert validate_config_value("
|
|
78
|
+
validate_config_value("settingDeviceGridWorkingRange", "1")
|
|
79
|
+
assert validate_config_value("settingDeviceGridWorkingRange", 1, access=ConfigAccess.ADVANCED) == "1"
|
|
80
|
+
with pytest.raises(ConfigValidationError):
|
|
81
|
+
validate_config_value("settingDeviceOutputSourcePriority", "0", access=ConfigAccess.CRITICAL)
|
|
80
82
|
with pytest.raises(ConfigAccessDenied):
|
|
81
83
|
validate_config_value(
|
|
82
84
|
"setBatteryCutOffVoltage",
|
|
@@ -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
|
|
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
|