python-bsblan 5.2.0__py3-none-any.whl → 5.2.1__py3-none-any.whl
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.
- bsblan/bsblan.py +16 -42
- bsblan/models.py +3 -3
- {python_bsblan-5.2.0.dist-info → python_bsblan-5.2.1.dist-info}/METADATA +1 -1
- {python_bsblan-5.2.0.dist-info → python_bsblan-5.2.1.dist-info}/RECORD +6 -6
- {python_bsblan-5.2.0.dist-info → python_bsblan-5.2.1.dist-info}/WHEEL +0 -0
- {python_bsblan-5.2.0.dist-info → python_bsblan-5.2.1.dist-info}/licenses/LICENSE.md +0 -0
bsblan/bsblan.py
CHANGED
|
@@ -152,13 +152,10 @@ class BSBLAN:
|
|
|
152
152
|
async def get_available_circuits(self) -> list[int]:
|
|
153
153
|
"""Detect which heating circuits are available on the device.
|
|
154
154
|
|
|
155
|
-
Uses
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
circuit returns ``value="0"`` with ``desc="---"``.
|
|
160
|
-
|
|
161
|
-
A circuit is only considered available when both checks pass.
|
|
155
|
+
Uses the configured operating mode probe parameters from
|
|
156
|
+
CircuitConfig.PROBE_PARAMS as the only discovery signal. Status
|
|
157
|
+
parameters are not queried during discovery to keep setup lightweight
|
|
158
|
+
and avoid excluding valid circuits when status data is unavailable.
|
|
162
159
|
|
|
163
160
|
This is useful for integration setup flows (e.g., Home Assistant
|
|
164
161
|
config flow) to discover how many circuits the user's controller
|
|
@@ -179,46 +176,23 @@ class BSBLAN:
|
|
|
179
176
|
response = await self._request(
|
|
180
177
|
params={"Parameter": param_id},
|
|
181
178
|
)
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
# Secondary check: query the status parameter.
|
|
188
|
-
# Inactive circuits either:
|
|
189
|
-
# - return value="0" and desc="---"
|
|
190
|
-
# - return an empty dict {} (param not supported)
|
|
191
|
-
status_id = CircuitConfig.STATUS_PARAMS[circuit]
|
|
192
|
-
status_resp = await self._request(
|
|
193
|
-
params={"Parameter": status_id},
|
|
179
|
+
except BSBLANError:
|
|
180
|
+
logger.debug(
|
|
181
|
+
"Circuit %d not available (operating mode request failed)",
|
|
182
|
+
circuit,
|
|
194
183
|
)
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
# Empty response means the parameter doesn't exist
|
|
198
|
-
if not status_data or not isinstance(status_data, dict):
|
|
199
|
-
logger.debug(
|
|
200
|
-
"Circuit %d has no status data (not supported)",
|
|
201
|
-
circuit,
|
|
202
|
-
)
|
|
203
|
-
continue
|
|
204
|
-
|
|
205
|
-
# value="0" + desc="---" means inactive
|
|
206
|
-
if (
|
|
207
|
-
status_data.get("desc") == CircuitConfig.INACTIVE_MARKER
|
|
208
|
-
and str(status_data.get("value", "")) == "0"
|
|
209
|
-
):
|
|
210
|
-
logger.debug(
|
|
211
|
-
"Circuit %d has status '---' (inactive)",
|
|
212
|
-
circuit,
|
|
213
|
-
)
|
|
214
|
-
continue
|
|
184
|
+
continue
|
|
215
185
|
|
|
216
|
-
|
|
217
|
-
|
|
186
|
+
# A circuit exists if the response contains the operating mode key
|
|
187
|
+
# with actual data (not an empty dict).
|
|
188
|
+
if not response.get(param_id):
|
|
218
189
|
logger.debug(
|
|
219
|
-
"Circuit %d
|
|
190
|
+
"Circuit %d has no operating mode data (not supported)",
|
|
220
191
|
circuit,
|
|
221
192
|
)
|
|
193
|
+
continue
|
|
194
|
+
|
|
195
|
+
available.append(circuit)
|
|
222
196
|
return sorted(available)
|
|
223
197
|
|
|
224
198
|
async def _setup_api_validator(self) -> None:
|
bsblan/models.py
CHANGED
|
@@ -326,13 +326,13 @@ class EntityInfo(BaseModel, Generic[T]):
|
|
|
326
326
|
unit: str
|
|
327
327
|
desc: str
|
|
328
328
|
value: T | None = None
|
|
329
|
-
data_type: int = Field(
|
|
329
|
+
data_type: int = Field(validation_alias="dataType", default=0)
|
|
330
330
|
error: int = 0
|
|
331
331
|
readonly: int = 0
|
|
332
332
|
readwrite: int = 0
|
|
333
333
|
precision: float | None = None
|
|
334
|
-
data_type_name: str = Field(default="",
|
|
335
|
-
data_type_family: str = Field(default="",
|
|
334
|
+
data_type_name: str = Field(default="", validation_alias="dataType_name")
|
|
335
|
+
data_type_family: str = Field(default="", validation_alias="dataType_family")
|
|
336
336
|
|
|
337
337
|
@model_validator(mode="before")
|
|
338
338
|
@classmethod
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
bsblan/__init__.py,sha256=YD_edvxHL5ocUE2iLWhdinqpsRYWJkVrcds0b6aKp9U,1288
|
|
2
|
-
bsblan/bsblan.py,sha256=
|
|
2
|
+
bsblan/bsblan.py,sha256=3aBmx9mSc0uWthM4m28z3wppH6FsbBA03CaStGEG9Co,61907
|
|
3
3
|
bsblan/constants.py,sha256=LoMSrEdZj2zohDFxOQ2JT7J4jIH9clXh7sfkNnnjl5A,22864
|
|
4
4
|
bsblan/exceptions.py,sha256=jL7qohIMmuVTsdWBB_trKPg5Yzim6JxaOT13h6EJPlk,1770
|
|
5
|
-
bsblan/models.py,sha256=
|
|
5
|
+
bsblan/models.py,sha256=DZlkRPh8vhe7dPDJyEofaAS1Fhgr_T7fum0lY3GzmHw,20738
|
|
6
6
|
bsblan/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
bsblan/utility.py,sha256=sS0wWJoqvLAHzwaSLIqQEQ-boHsYFLKAHw8KNTSmdX8,5772
|
|
8
|
-
python_bsblan-5.2.
|
|
9
|
-
python_bsblan-5.2.
|
|
10
|
-
python_bsblan-5.2.
|
|
11
|
-
python_bsblan-5.2.
|
|
8
|
+
python_bsblan-5.2.1.dist-info/METADATA,sha256=XbvdXo99frOZIvcEwbIPvvUdeQ8XCExcQmvOyIDsoe8,8529
|
|
9
|
+
python_bsblan-5.2.1.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
10
|
+
python_bsblan-5.2.1.dist-info/licenses/LICENSE.md,sha256=Shv8HPcD1WbZjBPvfb5r3h_cwaPeVaUZMUqU_XQGwGw,1092
|
|
11
|
+
python_bsblan-5.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|