diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/local/dto/TellstickLocalDeviceDTO.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/local/dto/TellstickLocalDeviceDTO.java index 148024514..56bc57c86 100644 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/local/dto/TellstickLocalDeviceDTO.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/local/dto/TellstickLocalDeviceDTO.java @@ -112,4 +112,21 @@ public class TellstickLocalDeviceDTO implements Device { public void setType(String type) { this.type = type; } + + @Override + public boolean equals(Object obj) { + // used to test if device exist + if (this == obj) { + return true; + } + if (!(obj instanceof TellstickLocalDeviceDTO other)) { + return false; + } + return deviceId == other.deviceId; + } + + @Override + public int hashCode() { + return deviceId; + } } diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/local/dto/TellstickLocalSensorDTO.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/local/dto/TellstickLocalSensorDTO.java index b3a754d10..5dd173271 100644 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/local/dto/TellstickLocalSensorDTO.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/local/dto/TellstickLocalSensorDTO.java @@ -127,4 +127,21 @@ public class TellstickLocalSensorDTO implements Device { public String getUUId() { return Integer.toString(deviceId); } + + @Override + public boolean equals(Object obj) { + // used to test if sensor exist + if (this == obj) { + return true; + } + if (!(obj instanceof TellstickLocalSensorDTO other)) { + return false; + } + return deviceId == other.deviceId; + } + + @Override + public int hashCode() { + return deviceId; + } }