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>
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.