Skip to content

Commit 8e570c5

Browse files
authored
[freeboxos] Fix creation of properties and dynamic channels at init (openhab#17081)
This was bypassed in bridgeStatusChanged. Fix openhab#17078 Fix openhab#17079 Signed-off-by: Laurent Garnier <[email protected]>
1 parent 8cf49eb commit 8e570c5

File tree

1 file changed

+7
-3
lines changed
  • bundles/org.openhab.binding.freeboxos/src/main/java/org/openhab/binding/freeboxos/internal/handler

1 file changed

+7
-3
lines changed

bundles/org.openhab.binding.freeboxos/src/main/java/org/openhab/binding/freeboxos/internal/handler/ApiConsumerHandler.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
import inet.ipaddr.IPAddress;
5959

6060
/**
61-
* The {@link ServerHandler} is a base abstract class for all devices made available by the FreeboxOs bridge
61+
* The {@link ApiConsumerHandler} is a base abstract class for all devices made available by the FreeboxOs bridge
6262
*
6363
* @author Gaël L'hopital - Initial contribution
6464
*/
@@ -80,7 +80,10 @@ public void initialize() {
8080
if (bridgeHandler == null) {
8181
return;
8282
}
83+
initializeOnceBridgeOnline(bridgeHandler);
84+
}
8385

86+
private void initializeOnceBridgeOnline(FreeboxOsHandler bridgeHandler) {
8487
Map<String, String> properties = editProperties();
8588
if (properties.isEmpty()) {
8689
try {
@@ -132,8 +135,9 @@ public <T extends RestManager> T getManager(Class<T> clazz) throws FreeboxExcept
132135

133136
@Override
134137
public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) {
135-
if (checkBridgeHandler() != null) {
136-
startRefreshJob();
138+
FreeboxOsHandler bridgeHandler = checkBridgeHandler();
139+
if (bridgeHandler != null) {
140+
initializeOnceBridgeOnline(bridgeHandler);
137141
} else {
138142
stopJobs();
139143
}

0 commit comments

Comments
 (0)