Skip to content

Commit

Permalink
[hydrawise] fixes null pointer error for some sprinkler controllers (o…
Browse files Browse the repository at this point in the history
…penhab#13965)

Signed-off-by: Dan Cunningham <[email protected]>
Signed-off-by: Ben Rosenblum <[email protected]>
  • Loading branch information
digitaldan authored and morph166955 committed Dec 18, 2022
1 parent a3e3ef8 commit d2d029d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,7 @@ public void onData(List<Controller> controllers) {
// update values with what the cloud tells us even though the controller may be offline
if (!controller.status.online) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
String.format("Controller Offline: %s last seen %s", controller.status.summary,
secondsToDateTime(controller.status.lastContact.timestamp)));
"Service reports controller as offline");
} else if (getThing().getStatus() != ThingStatus.ONLINE) {
updateStatus(ThingStatus.ONLINE);
}
Expand All @@ -277,7 +276,8 @@ private void updateController(Controller controller) {
updateGroupState(CHANNEL_GROUP_CONTROLLER_SYSTEM, CHANNEL_CONTROLLER_SUMMARY,
new StringType(controller.status.summary));
updateGroupState(CHANNEL_GROUP_CONTROLLER_SYSTEM, CHANNEL_CONTROLLER_LAST_CONTACT,
secondsToDateTime(controller.status.lastContact.timestamp));
controller.status.lastContact != null ? secondsToDateTime(controller.status.lastContact.timestamp)
: UnDefType.NULL);
}

private void updateZones(List<Zone> zones) {
Expand Down

0 comments on commit d2d029d

Please sign in to comment.