Skip to content

Commit

Permalink
Fix sensor and device update (openhab#15596)
Browse files Browse the repository at this point in the history
Signed-off-by: AndreasV <andreas.viborg@gmail.com>
  • Loading branch information
aviborg authored and querdenker2k committed Oct 21, 2023
1 parent 2dbe40c commit 43a7442
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,21 @@ public String getType() {
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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,21 @@ public void setSensorId(int sensorId) {
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;
}
}

0 comments on commit 43a7442

Please sign in to comment.