mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[homekit] Fix duplicate name characteristic errors (#17151)
Depending on how the accessory initializes, optional characteristics may be added before or after the service. For IrrigationSystem, it's added before optional characteristics. Signed-off-by: Cody Cutrer <cody@cutrer.us> Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
parent
3808984572
commit
180a78e461
@ -451,6 +451,10 @@ public abstract class AbstractHomekitAccessoryImpl implements HomekitAccessory {
|
||||
return;
|
||||
}
|
||||
rawCharacteristics.put(characteristic.getClass(), characteristic);
|
||||
// belongs on the accessory information service
|
||||
if (characteristic.getClass() == NameCharacteristic.class) {
|
||||
return;
|
||||
}
|
||||
var service = getPrimaryService();
|
||||
if (service != null) {
|
||||
// find the corresponding add method at service and call it.
|
||||
|
Loading…
Reference in New Issue
Block a user