mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-25 14:55:55 +01:00
Fix duplicate channel bug (#8980)
Signed-off-by: Connor Petty <mistercpp2000+gitsignoff@gmail.com>
This commit is contained in:
parent
d3bf62bb3b
commit
bb9a286167
@ -102,11 +102,17 @@ public class BeaconBluetoothHandler extends BaseThingHandler implements Bluetoot
|
||||
}
|
||||
|
||||
ThingBuilder builder = editThing();
|
||||
boolean changed = false;
|
||||
for (Channel channel : createDynamicChannels()) {
|
||||
// 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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user