Fix duplicate channel bug (#8980)
Signed-off-by: Connor Petty <mistercpp2000+gitsignoff@gmail.com>
This commit is contained in:
@@ -102,11 +102,17 @@ public class BeaconBluetoothHandler extends BaseThingHandler implements Bluetoot
|
|||||||
}
|
}
|
||||||
|
|
||||||
ThingBuilder builder = editThing();
|
ThingBuilder builder = editThing();
|
||||||
|
boolean changed = false;
|
||||||
for (Channel channel : createDynamicChannels()) {
|
for (Channel channel : createDynamicChannels()) {
|
||||||
// we only want to add each channel, not replace all of them
|
// we only want to add each channel, not replace all of them
|
||||||
builder.withChannel(channel);
|
if (getThing().getChannel(channel.getUID()) == null) {
|
||||||
|
builder.withChannel(channel);
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (changed) {
|
||||||
|
updateThing(builder.build());
|
||||||
}
|
}
|
||||||
updateThing(builder.build());
|
|
||||||
|
|
||||||
updateStatus(ThingStatus.UNKNOWN);
|
updateStatus(ThingStatus.UNKNOWN);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user