@Override
public void initialize() {
- updateStatus(ThingStatus.UNKNOWN);
initializeFuture = scheduler.schedule(this::scheduledInitialize, 1, TimeUnit.SECONDS);
return;
}
return;
}
- updateStatus(ThingStatus.ONLINE);
+ if (this.thing.getStatus() != ThingStatus.ONLINE) {
+ updateStatus(ThingStatus.ONLINE);
+ }
+
logger.debug("Succesfully opened connection to Hayward's server: {} Username:{}", config.endpointUrl,
config.username);
commFailureCount++;
return;
}
+ updateStatus(ThingStatus.ONLINE);
} catch (HaywardException e) {
logger.debug("Hayward Connection thing: Exception during poll: {}", e.getMessage());
} catch (InterruptedException e) {
int status = httpResponse.getStatus();
String xmlResponse = httpResponse.getContentAsString();
- List<String> statusMessages = evaluateXPath("/Response/Parameters//Parameter[@name='StatusMessage']/text()",
- xmlResponse);
- if (!(statusMessages.isEmpty())) {
- statusMessage = statusMessages.get(0);
- } else {
- statusMessage = httpResponse.getReason();
- }
-
if (status == 200) {
+ List<String> statusMessages = evaluateXPath(
+ "/Response/Parameters//Parameter[@name='StatusMessage']/text()", xmlResponse);
+ if (!(statusMessages.isEmpty())) {
+ statusMessage = statusMessages.get(0);
+ } else {
+ statusMessage = httpResponse.getReason();
+ }
+
if (logger.isTraceEnabled()) {
logger.trace("Hayward Connection thing: {} Hayward http command: {}", getCallingMethod(),
urlParameters);
if (logger.isDebugEnabled()) {
logger.debug("Hayward Connection thing: {} Hayward http command: {}", getCallingMethod(),
urlParameters);
- logger.debug("Hayward Connection thing: {} Hayward http response: {}", getCallingMethod(), status);
+ logger.debug("Hayward Connection thing: {} Hayward http response: {} {}", getCallingMethod(),
+ status, xmlResponse);
}
return "";
}