mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[insteon] handle cases when channelLinked is not called after initialization (#8803)
Signed-off-by: Rob Nielsen <rob.nielsen@yahoo.com>
This commit is contained in:
parent
62109eef64
commit
0f3112d3f8
@ -314,6 +314,12 @@ public class InsteonDeviceHandler extends BaseThingHandler {
|
||||
|
||||
getInsteonNetworkHandler().initialized(getThing().getUID(), msg);
|
||||
|
||||
channels.forEach(channel -> {
|
||||
if (isLinked(channel.getUID())) {
|
||||
channelLinked(channel.getUID());
|
||||
}
|
||||
});
|
||||
|
||||
updateStatus(ThingStatus.ONLINE);
|
||||
} else {
|
||||
String msg = "Product key '" + productKey
|
||||
@ -358,6 +364,10 @@ public class InsteonDeviceHandler extends BaseThingHandler {
|
||||
|
||||
@Override
|
||||
public void channelLinked(ChannelUID channelUID) {
|
||||
if (getInsteonNetworkHandler().isChannelLinked(channelUID)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, @Nullable String> params = new HashMap<>();
|
||||
Channel channel = getThing().getChannel(channelUID.getId());
|
||||
|
||||
|
@ -201,6 +201,10 @@ public class InsteonNetworkHandler extends BaseBridgeHandler {
|
||||
deviceInfo.remove(uid.getAsString());
|
||||
}
|
||||
|
||||
public boolean isChannelLinked(ChannelUID uid) {
|
||||
return channelInfo.containsKey(uid.getAsString());
|
||||
}
|
||||
|
||||
public void linked(ChannelUID uid, String msg) {
|
||||
channelInfo.put(uid.getAsString(), msg);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user