From 40368884337d7800e8fd4106b656e3ab66cef7a1 Mon Sep 17 00:00:00 2001 From: Andrew Fiddian-Green Date: Thu, 16 Jun 2022 21:44:25 +0200 Subject: [PATCH] [gardena] remove compiler warnings (#12947) Signed-off-by: Andrew Fiddian-Green --- bundles/org.openhab.binding.gardena/README.md | 1 + .../org/openhab/binding/gardena/internal/model/dto/Device.java | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.gardena/README.md b/bundles/org.openhab.binding.gardena/README.md index 48a2f8842..21e7c3562 100644 --- a/bundles/org.openhab.binding.gardena/README.md +++ b/bundles/org.openhab.binding.gardena/README.md @@ -108,6 +108,7 @@ openhab:send WC_Valve_cmd_CloseValve.sendCommand(ON) // stop any active watering ``` If you send a REFRESH command to the last update timestamp (no matter which thing), **ALL** items from **ALL** things are updated + ``` DateTime LastUpdate "LastUpdate [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel="gardena:water_control:home:myWateringComputer:common#lastUpdate_timestamp" } diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/dto/Device.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/dto/Device.java index 4514a67fc..6c6d091de 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/dto/Device.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/dto/Device.java @@ -126,8 +126,7 @@ public class Device { valveSet = (ValveSetServiceDataItem) dataItem; } else if (dataItem instanceof ValveServiceDataItem) { String valveNumber = StringUtils.substringAfterLast(dataItem.id, ":"); - if (valveNumber != null - && (valveNumber.equals("") || valveNumber.equals("wc") || valveNumber.equals("0"))) { + if ("".equals(valveNumber) || "wc".equals(valveNumber) || "0".equals(valveNumber)) { valve = (ValveServiceDataItem) dataItem; } else if ("1".equals(valveNumber)) { valveOne = (ValveServiceDataItem) dataItem;