[digitalstrom] remove unnecessary call to bridgeStatusChanged (#9263)

Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
J-N-K 2020-12-07 21:35:35 +01:00 committed by GitHub
parent a44f7f17cc
commit beacec311e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 2 additions and 21 deletions

View File

@ -64,7 +64,6 @@ import org.openhab.core.thing.ThingStatusDetail;
import org.openhab.core.thing.ThingTypeUID; import org.openhab.core.thing.ThingTypeUID;
import org.openhab.core.thing.binding.BaseBridgeHandler; import org.openhab.core.thing.binding.BaseBridgeHandler;
import org.openhab.core.thing.binding.ThingHandler; import org.openhab.core.thing.binding.ThingHandler;
import org.openhab.core.thing.binding.builder.ThingStatusInfoBuilder;
import org.openhab.core.types.Command; import org.openhab.core.types.Command;
import org.openhab.core.types.RefreshType; import org.openhab.core.types.RefreshType;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -367,14 +366,8 @@ public class BridgeHandler extends BaseBridgeHandler
@Override @Override
public void handleRemoval() { public void handleRemoval() {
for (Thing thing : getThing().getThings()) { String applicationToken = (String) super.getConfig().get(APPLICATION_TOKEN);
// Inform Thing-Child's about removed bridge. if (applicationToken != null && !applicationToken.isEmpty()) {
final ThingHandler thingHandler = thing.getHandler();
if (thingHandler != null) {
thingHandler.bridgeStatusChanged(ThingStatusInfoBuilder.create(ThingStatus.REMOVED).build());
}
}
if (StringUtils.isNotBlank((String) super.getConfig().get(APPLICATION_TOKEN))) {
if (connMan == null) { if (connMan == null) {
Config config = loadAndCheckConnectionData(this.getConfig()); Config config = loadAndCheckConnectionData(this.getConfig());
if (config != null) { if (config != null) {

View File

@ -151,9 +151,6 @@ public class CircuitHandler extends BaseThingHandler implements DeviceStatusList
if (bridgeStatusInfo.getStatus().equals(ThingStatus.OFFLINE)) { if (bridgeStatusInfo.getStatus().equals(ThingStatus.OFFLINE)) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE);
} }
if (bridgeStatusInfo.getStatus().equals(ThingStatus.REMOVED)) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, "Bridge has been removed.");
}
logger.debug("Set status to {}", getThing().getStatusInfo()); logger.debug("Set status to {}", getThing().getStatusInfo());
} }

View File

@ -176,9 +176,6 @@ public class DeviceHandler extends BaseThingHandler implements DeviceStatusListe
if (bridgeStatusInfo.getStatus().equals(ThingStatus.OFFLINE)) { if (bridgeStatusInfo.getStatus().equals(ThingStatus.OFFLINE)) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE);
} }
if (bridgeStatusInfo.getStatus().equals(ThingStatus.REMOVED)) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, "Bridge has been removed.");
}
logger.debug("Set status to {}", getThing().getStatusInfo()); logger.debug("Set status to {}", getThing().getStatusInfo());
} }

View File

@ -171,9 +171,6 @@ public class SceneHandler extends BaseThingHandler implements SceneStatusListene
if (bridgeStatusInfo.getStatus().equals(ThingStatus.OFFLINE)) { if (bridgeStatusInfo.getStatus().equals(ThingStatus.OFFLINE)) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE);
} }
if (bridgeStatusInfo.getStatus().equals(ThingStatus.REMOVED)) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, "Bridge has been removed.");
}
logger.debug("Set status to {}", getThing().getStatusInfo()); logger.debug("Set status to {}", getThing().getStatusInfo());
} }

View File

@ -186,9 +186,6 @@ public class ZoneTemperatureControlHandler extends BaseThingHandler implements T
if (bridgeStatusInfo.getStatus().equals(ThingStatus.OFFLINE)) { if (bridgeStatusInfo.getStatus().equals(ThingStatus.OFFLINE)) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE);
} }
if (bridgeStatusInfo.getStatus().equals(ThingStatus.REMOVED)) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, "Bridge has been removed.");
}
logger.debug("Set status to {}", getThing().getStatusInfo()); logger.debug("Set status to {}", getThing().getStatusInfo());
} }