}
if (bridge.getStatus() == OFFLINE) {
updateStatus(OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE, "The UniFi Controller is currently offline.");
+ return;
}
// mgb: derive the config class from the generic type
Class<?> clazz = (Class<?>) (((ParameterizedType) getClass().getGenericSuperclass())
@Override
protected synchronized void initialize(UniFiClientThingConfig config) {
// mgb: called when the config changes
- if (thing.getStatus() == INITIALIZING) {
- logger.debug("Initializing the UniFi Client Handler with config = {}", config);
- if (!config.isValid()) {
- updateStatus(OFFLINE, CONFIGURATION_ERROR,
- "You must define a MAC address, IP address, hostname or alias for this thing.");
- return;
- }
- this.config = config;
- updateStatus(ONLINE);
+ logger.debug("Initializing the UniFi Client Handler with config = {}", config);
+ if (!config.isValid()) {
+ updateStatus(OFFLINE, CONFIGURATION_ERROR,
+ "You must define a MAC address, IP address, hostname or alias for this thing.");
+ return;
}
+ this.config = config;
+ updateStatus(ONLINE);
}
private static boolean belongsToSite(UniFiClient client, String siteName) {