Skip to content

Commit 4ed138e

Browse files
authored
fix: Don't create device when no IEC devices in contract (#243)
1 parent 3b678fb commit 4ed138e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

custom_components/iec/coordinator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,8 @@ async def _update_data(
454454

455455
devices = await self._get_devices_by_contract_id(contract_id)
456456
if not devices:
457-
_LOGGER.debug(f"No devices for contract {contract_id}")
457+
_LOGGER.debug(f"No devices for contract {contract_id}. Skipping creating devices.")
458+
continue
458459

459460
for device in devices or []:
460461
attributes_to_add[METER_ID_ATTR_NAME] = device.device_number

0 commit comments

Comments
 (0)