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

@@ -68,15 +68,16 @@ class JackeryMainNumber(NumberEntity):
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
self._attr_mode = NumberMode.SLIDER
self._attr_native_min_value = min_value
self._attr_native_max_value = max_value
self._attr_native_step = step
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",
}