added support for multiple instances
Some checks failed
Validate / Validate (push) Has been cancelled

This commit is contained in:
2026-05-31 11:36:30 +02:00
parent 1f122f2235
commit 85eed58a06
6 changed files with 22 additions and 20 deletions

View File

@@ -167,11 +167,12 @@ class JackeryMainSwitch(SwitchEntity):
self._key = key
self._coordinator = coordinator
self._attr_name = name
self._attr_unique_id = f"jackery_main_{key}"
self._attr_unique_id = f"jackery_{config_entry_id}_main_{key}"
self._attr_has_entity_name = True
device_sn = coordinator._device_sn or "Unknown"
self._attr_device_info = {
"identifiers": {(DOMAIN, config_entry_id)},
"name": "Jackery",
"name": f"Jackery {device_sn}",
"manufacturer": "Jackery",
"model": "Energy Monitor",
}