mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[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> Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
parent
7ca330f090
commit
5e51d93c30
@ -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();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user