mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-25 14:55:55 +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>
This commit is contained in:
parent
9ae9adf6f6
commit
b39e3a79bc
@ -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