Skip to content

Commit

Permalink
Fix discovery of TRVs when rooms with no TRVs exist
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Schofield <[email protected]> (github: andrew-schofield)
  • Loading branch information
andrew-schofield committed Mar 14, 2018
1 parent 47513c7 commit c9bf0b2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,17 @@ public Room getRoomForDeviceId(Integer id) {
if (room.getRoomStatId() != null && room.getRoomStatId().equals(id)) {
return room;
}
for (Integer itrv : room.getSmartValveIds()) {

List<Integer> trvs = room.getSmartValveIds();
if (trvs != null) {
for (Integer itrv : trvs) {
if (itrv.equals(id)) {
return room;
}
}
}
}
}

return null;
}
Expand Down

0 comments on commit c9bf0b2

Please sign in to comment.