feat: make the sync of garbage types optional

If the selected type is "Skip synchro", the ecocito data won't contain the related coordinator(s)
and any sync of that type will be skipped.
This commit is contained in:
Xavier Morel
2025-04-03 15:35:36 +02:00
parent 8e900002ef
commit 67016339b3
3 changed files with 28 additions and 19 deletions

View File

@@ -237,5 +237,6 @@ async def async_setup_entry(
entities: list[EcocitoSensor[Any]] = []
for coordinator_type, description in SENSOR_TYPES:
coordinator = getattr(entry.runtime_data, coordinator_type)
entities.append(EcocitoSensor(coordinator, description))
if coordinator:
entities.append(EcocitoSensor(coordinator, description))
async_add_entities(entities)