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 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 a two-step probe for each circuit (1, 2):
156
- 1. Query the operating mode parameter — the response must be
157
- non-empty and contain actual data.
158
- 2. Query the status parameter (8000/8001) an inactive
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
- # A circuit exists if the response contains the param_id key
183
- # with actual data (not an empty dict)
184
- if not response.get(param_id):
185
- continue
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
- status_data = status_resp.get(status_id, {})
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
- available.append(circuit)
217
- except BSBLANError:
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 not available (request failed)",
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(alias="dataType", default=0)
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="", alias="dataType_name")
335
- data_type_family: str = Field(default="", alias="dataType_family")
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-bsblan
3
- Version: 5.2.0
3
+ Version: 5.2.1
4
4
  Summary: Asynchronous Python client for BSBLAN API
5
5
  Project-URL: Homepage, https://github.com/liudger/python-bsblan
6
6
  Project-URL: Repository, https://github.com/liudger/python-bsblan
@@ -1,11 +1,11 @@
1
1
  bsblan/__init__.py,sha256=YD_edvxHL5ocUE2iLWhdinqpsRYWJkVrcds0b6aKp9U,1288
2
- bsblan/bsblan.py,sha256=PCNForRgeJFHwZRE_mEcvySQxiYLA2JCIzMJu429Fq4,63034
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=qEycc2eVkCK2CXWDXBSqtTyM-to6pH7jX6aKvXeH3R8,20705
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.0.dist-info/METADATA,sha256=MjhQBz4cjiRwunT2OH4X-gRFsprNSIpLBMNu7kam24Y,8529
9
- python_bsblan-5.2.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
10
- python_bsblan-5.2.0.dist-info/licenses/LICENSE.md,sha256=Shv8HPcD1WbZjBPvfb5r3h_cwaPeVaUZMUqU_XQGwGw,1092
11
- python_bsblan-5.2.0.dist-info/RECORD,,
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,,