Skip to content

Commit

Permalink
Update status change and logging
Browse files Browse the repository at this point in the history
  • Loading branch information
pbogut committed Aug 21, 2020
1 parent 94b787b commit 245e30b
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void handleCommand(ChannelUID channelUID, Command command) {
tryNo++;
} catch (Exception e) {
logger.warn("EWPESmart failed to update channel {} due to {} ", channelUID.getId(), e.getMessage());
// updateStatus(ThingStatus.OFFLINE);
updateStatus(ThingStatus.OFFLINE);
// e.printStackTrace();
break;
}
Expand Down Expand Up @@ -165,7 +165,6 @@ private void bindDevice() throws SocketTimeoutException {
return;
}
}
updateStatus(ThingStatus.ONLINE);
} catch (SocketTimeoutException e) {
// bubble up so we can retry
throw e;
Expand All @@ -177,7 +176,6 @@ private void bindDevice() throws SocketTimeoutException {
logger.debug("EWPESmart failed to scan for airconditioners due to {} ({})", e.getMessage(), e.getClass());
}
updateStatus(ThingStatus.OFFLINE);
// updateStatus(ThingStatus.ONLINE);
}

private void startAutomaticRefresh() {
Expand Down Expand Up @@ -206,9 +204,12 @@ public void run() {
for (Channel channel : channels) {
publishChannelIfLinked(channel.getUID());
}

} catch (SocketTimeoutException e) {
//we dont care too much, will try again
logger.debug("EWPESmart: failed during automatic update of airconditioner values due to Timeout");
} catch (Exception e) {
logger.debug("EWPESmart failed during automatic update of airconditioner values due to {} ({}) ", e.getMessage(), e.getClass());
logger.warn("EWPESmart: failed during automatic update of airconditioner values due to {} ({}) ", e.getMessage(), e.getClass());
// e.printStackTrace();
} finally {
isRefreshing = false;
}
Expand Down

0 comments on commit 245e30b

Please sign in to comment.