[freeboxos] Fix creation of properties and dynamic channels at init (#17081)

This was bypassed in bridgeStatusChanged.

Fix #17078
Fix #17079

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo 2024-07-16 17:52:57 +02:00 committed by GitHub
parent 8cf49ebee3
commit 8e570c5afa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -58,7 +58,7 @@ import org.slf4j.LoggerFactory;
import inet.ipaddr.IPAddress; import inet.ipaddr.IPAddress;
/** /**
* The {@link ServerHandler} is a base abstract class for all devices made available by the FreeboxOs bridge * The {@link ApiConsumerHandler} is a base abstract class for all devices made available by the FreeboxOs bridge
* *
* @author Gaël L'hopital - Initial contribution * @author Gaël L'hopital - Initial contribution
*/ */
@ -80,7 +80,10 @@ public abstract class ApiConsumerHandler extends BaseThingHandler implements Api
if (bridgeHandler == null) { if (bridgeHandler == null) {
return; return;
} }
initializeOnceBridgeOnline(bridgeHandler);
}
private void initializeOnceBridgeOnline(FreeboxOsHandler bridgeHandler) {
Map<String, String> properties = editProperties(); Map<String, String> properties = editProperties();
if (properties.isEmpty()) { if (properties.isEmpty()) {
try { try {
@ -132,8 +135,9 @@ public abstract class ApiConsumerHandler extends BaseThingHandler implements Api
@Override @Override
public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) {
if (checkBridgeHandler() != null) { FreeboxOsHandler bridgeHandler = checkBridgeHandler();
startRefreshJob(); if (bridgeHandler != null) {
initializeOnceBridgeOnline(bridgeHandler);
} else { } else {
stopJobs(); stopJobs();
} }