mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-27 07:41:39 +01:00
[hydrawise] fixes null pointer error for some sprinkler controllers (#13965)
Signed-off-by: Dan Cunningham <dan@digitaldan.com>
This commit is contained in:
parent
15ad22b5ad
commit
ab504bc69e
@ -258,8 +258,7 @@ public class HydrawiseControllerHandler extends BaseThingHandler implements Hydr
|
|||||||
// update values with what the cloud tells us even though the controller may be offline
|
// update values with what the cloud tells us even though the controller may be offline
|
||||||
if (!controller.status.online) {
|
if (!controller.status.online) {
|
||||||
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
|
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
|
||||||
String.format("Controller Offline: %s last seen %s", controller.status.summary,
|
"Service reports controller as offline");
|
||||||
secondsToDateTime(controller.status.lastContact.timestamp)));
|
|
||||||
} else if (getThing().getStatus() != ThingStatus.ONLINE) {
|
} else if (getThing().getStatus() != ThingStatus.ONLINE) {
|
||||||
updateStatus(ThingStatus.ONLINE);
|
updateStatus(ThingStatus.ONLINE);
|
||||||
}
|
}
|
||||||
@ -277,7 +276,8 @@ public class HydrawiseControllerHandler extends BaseThingHandler implements Hydr
|
|||||||
updateGroupState(CHANNEL_GROUP_CONTROLLER_SYSTEM, CHANNEL_CONTROLLER_SUMMARY,
|
updateGroupState(CHANNEL_GROUP_CONTROLLER_SYSTEM, CHANNEL_CONTROLLER_SUMMARY,
|
||||||
new StringType(controller.status.summary));
|
new StringType(controller.status.summary));
|
||||||
updateGroupState(CHANNEL_GROUP_CONTROLLER_SYSTEM, CHANNEL_CONTROLLER_LAST_CONTACT,
|
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) {
|
private void updateZones(List<Zone> zones) {
|
||||||
|
Loading…
Reference in New Issue
Block a user