addSubscription(DEVICEEVENT);
pollingJob = scheduler.scheduleWithFixedDelay(this::poll, 0, DEFAULT_REFRESH_INTERVAL_SECONDS,
TimeUnit.SECONDS);
- updateStatus(ThingStatus.ONLINE);
+ updateStatus(ThingStatus.UNKNOWN);
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/config-status.error.missing-udn");
- logger.debug("Cannot initalize WemoCoffeeHandler. UDN not set.");
}
}
logger.debug("Polling job");
// Check if the Wemo device is set in the UPnP service registry
- // If not, set the thing state to ONLINE/CONFIG-PENDING and wait for the next poll
if (!isUpnpDeviceRegistered()) {
logger.debug("UPnP device {} not yet registered", getUDN());
- updateStatus(ThingStatus.ONLINE, ThingStatusDetail.CONFIGURATION_PENDING,
+ updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE,
"@text/config-status.pending.device-not-registered [\"" + getUDN() + "\"]");
return;
}
addSubscription(BASICEVENT);
pollingJob = scheduler.scheduleWithFixedDelay(this::poll, 0, DEFAULT_REFRESH_INTERVAL_SECONDS,
TimeUnit.SECONDS);
- updateStatus(ThingStatus.ONLINE);
+ updateStatus(ThingStatus.UNKNOWN);
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/config-status.error.missing-udn");
- logger.debug("Cannot initalize WemoCrockpotHandler. UDN not set.");
}
}
try {
logger.debug("Polling job");
// Check if the Wemo device is set in the UPnP service registry
- // If not, set the thing state to ONLINE/CONFIG-PENDING and wait for the next poll
if (!isUpnpDeviceRegistered()) {
logger.debug("UPnP device {} not yet registered", getUDN());
- updateStatus(ThingStatus.ONLINE, ThingStatusDetail.CONFIGURATION_PENDING,
+ updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE,
"@text/config-status.pending.device-not-registered [\"" + getUDN() + "\"]");
return;
}
addSubscription(BASICEVENT);
pollingJob = scheduler.scheduleWithFixedDelay(this::poll, 0, DEFAULT_REFRESH_INTERVAL_SECONDS,
TimeUnit.SECONDS);
- updateStatus(ThingStatus.ONLINE);
+ updateStatus(ThingStatus.UNKNOWN);
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/config-status.error.missing-udn");
- logger.debug("Cannot initalize WemoDimmerHandler. UDN not set.");
}
}
try {
logger.debug("Polling job");
// Check if the Wemo device is set in the UPnP service registry
- // If not, set the thing state to ONLINE/CONFIG-PENDING and wait for the next poll
if (!isUpnpDeviceRegistered()) {
logger.debug("UPnP device {} not yet registered", getUDN());
- updateStatus(ThingStatus.ONLINE, ThingStatusDetail.CONFIGURATION_PENDING,
+ updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE,
"@text/config-status.pending.device-not-registered [\"" + getUDN() + "\"]");
return;
}
}
pollingJob = scheduler.scheduleWithFixedDelay(this::poll, 0, DEFAULT_REFRESH_INTERVAL_SECONDS,
TimeUnit.SECONDS);
- updateStatus(ThingStatus.ONLINE);
+ updateStatus(ThingStatus.UNKNOWN);
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/config-status.error.missing-udn");
- logger.debug("Cannot initalize WemoHandler. UDN not set.");
}
}
try {
logger.debug("Polling job");
// Check if the Wemo device is set in the UPnP service registry
- // If not, set the thing state to ONLINE/CONFIG-PENDING and wait for the next poll
if (!isUpnpDeviceRegistered()) {
logger.debug("UPnP device {} not yet registered", getUDN());
- updateStatus(ThingStatus.ONLINE, ThingStatusDetail.CONFIGURATION_PENDING,
+ updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE,
"@text/config-status.pending.device-not-registered [\"" + getUDN() + "\"]");
return;
}
logger.trace("New state '{}' for device '{}' received", value, getThing().getUID());
this.onValueReceived(variable, value, actionService + "1");
}
+ updateStatus(ThingStatus.ONLINE);
} catch (Exception e) {
logger.warn("Failed to get actual state for device '{}': {}", getThing().getUID(), e.getMessage());
+ updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage());
}
}
}
addSubscription(BASICEVENT);
pollingJob = scheduler.scheduleWithFixedDelay(this::poll, 0, DEFAULT_REFRESH_INTERVAL_SECONDS,
TimeUnit.SECONDS);
- updateStatus(ThingStatus.ONLINE);
+ updateStatus(ThingStatus.UNKNOWN);
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/config-status.error.missing-udn");
- logger.debug("Cannot initalize WemoHolmesHandler. UDN not set.");
}
}
try {
logger.debug("Polling job");
// Check if the Wemo device is set in the UPnP service registry
- // If not, set the thing state to ONLINE/CONFIG-PENDING and wait for the next poll
if (!isUpnpDeviceRegistered()) {
logger.debug("UPnP device {} not yet registered", getUDN());
- updateStatus(ThingStatus.ONLINE, ThingStatusDetail.CONFIGURATION_PENDING,
+ updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE,
"@text/config-status.pending.device-not-registered [\"" + getUDN() + "\"]");
return;
}
addSubscription(BRIDGEEVENT);
pollingJob = scheduler.scheduleWithFixedDelay(this::poll, DEFAULT_REFRESH_INITIAL_DELAY,
DEFAULT_REFRESH_INTERVAL_SECONDS, TimeUnit.SECONDS);
- updateStatus(ThingStatus.ONLINE);
+ updateStatus(ThingStatus.UNKNOWN);
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.BRIDGE_OFFLINE);
}
if (bridgeStatusInfo.getStatus().equals(ThingStatus.ONLINE)) {
updateStatus(ThingStatus.ONLINE);
} else {
- updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.BRIDGE_OFFLINE);
+ updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE);
ScheduledFuture<?> job = this.pollingJob;
if (job != null && !job.isCancelled()) {
job.cancel(true);
try {
logger.debug("Polling job");
// Check if the Wemo device is set in the UPnP service registry
- // If not, set the thing state to ONLINE/CONFIG-PENDING and wait for the next poll
if (!isUpnpDeviceRegistered()) {
logger.debug("UPnP device {} not yet registered", getUDN());
- updateStatus(ThingStatus.ONLINE, ThingStatusDetail.CONFIGURATION_PENDING,
+ updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE,
"@text/config-status.pending.device-not-registered [\"" + getUDN() + "\"]");
return;
}
logger.debug("Initializing WemoMakerHandler for UDN '{}'", configuration.get(UDN));
pollingJob = scheduler.scheduleWithFixedDelay(this::poll, 0, DEFAULT_REFRESH_INTERVAL_SECONDS,
TimeUnit.SECONDS);
- updateStatus(ThingStatus.ONLINE);
+ updateStatus(ThingStatus.UNKNOWN);
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/config-status.error.missing-udn");
- logger.debug("Cannot initalize WemoMakerHandler. UDN not set.");
}
}
try {
logger.debug("Polling job");
// Check if the Wemo device is set in the UPnP service registry
- // If not, set the thing state to ONLINE/CONFIG-PENDING and wait for the next poll
if (!isUpnpDeviceRegistered()) {
logger.debug("UPnP device {} not yet registered", getUDN());
- updateStatus(ThingStatus.ONLINE, ThingStatusDetail.CONFIGURATION_PENDING,
+ updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE,
"@text/config-status.pending.device-not-registered [\"" + getUDN() + "\"]");
return;
}
Thing thing = createThing(THING_TYPE_UID, DEFAULT_TEST_CHANNEL, DEFAULT_TEST_CHANNEL_TYPE);
waitForAssert(() -> {
- assertThat(thing.getStatus(), is(ThingStatus.ONLINE));
+ assertThat(thing.getStatus(), is(ThingStatus.UNKNOWN));
});
// The device is registered as UPnP Device after the initialization, this will ensure that the polling job will
Thing thing = createThing(THING_TYPE_UID, DEFAULT_TEST_CHANNEL, DEFAULT_TEST_CHANNEL_TYPE);
waitForAssert(() -> {
- assertThat(thing.getStatus(), is(ThingStatus.ONLINE));
+ assertThat(thing.getStatus(), is(ThingStatus.OFFLINE));
});
// The device is registered as UPnP Device after the initialization, this will ensure that the polling job will
});
waitForAssert(() -> {
- assertThat(thing.getStatus(), is(ThingStatus.ONLINE));
+ assertThat(thing.getStatus(), is(ThingStatus.UNKNOWN));
});
// The device is registered as UPnP Device after the initialization, this will ensure that the polling job will
Thing thing = createThing(THING_TYPE_UID, DEFAULT_TEST_CHANNEL, DEFAULT_TEST_CHANNEL_TYPE);
waitForAssert(() -> {
- assertThat(thing.getStatus(), is(ThingStatus.ONLINE));
+ assertThat(thing.getStatus(), is(ThingStatus.OFFLINE));
});
// The Device is registered as UPnP Device after the initialization, this will ensure that the polling job will
Thing thing = createThing(THING_TYPE_UID, DEFAULT_TEST_CHANNEL, DEFAULT_TEST_CHANNEL_TYPE);
waitForAssert(() -> {
- assertThat(thing.getStatus(), is(ThingStatus.ONLINE));
+ assertThat(thing.getStatus(), is(ThingStatus.OFFLINE));
});
// The Device is registered as UPnP Device after the initialization, this will ensure that the polling job will