Skip to content

Commit

Permalink
Protect maximum temperature setting
Browse files Browse the repository at this point in the history
Signed-off-by: clinique <gael@lhopital.org>
  • Loading branch information
clinique committed Feb 25, 2022
1 parent 6526f69 commit df04e05
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void setRoomThermpoint(String homeId, String roomId, SetpointMode mode, l
if (mode == SetpointMode.MANUAL || mode == SetpointMode.MAX) {
uriBuilder.queryParam("endtime", endtime);
if (mode == SetpointMode.MANUAL) {
uriBuilder.queryParam("temp", temp);
uriBuilder.queryParam("temp", temp > 30 ? 30 : temp);
}
}
post(uriBuilder, ApiResponse.Ok.class, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public int getSetpointDefaultDuration() {
public void callSetRoomThermTemp(String roomId, double temperature) {
try {
api.setRoomThermpoint(homeId, roomId, SetpointMode.MANUAL, setpointEndTimeFromNow(setPointDefaultDuration),
temperature > 30 ? 30 : temperature);
temperature);
expireData();
} catch (NetatmoException e) {
logger.warn("Error setting room target temperature '{}' : {}", roomId, e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@
<label>Setpoint</label>
<description>Thermostat temperature setpoint.</description>
<category>Temperature</category>
<tags>
<tag>Setpoint</tag>
<tag>Temperature</tag>
<tags>
<tag>Setpoint</tag>
<tag>Temperature</tag>
</tags>
<state pattern="%.1f %unit%" readOnly="false" min="7" max="30" step="0.5"/>
</channel-type>
Expand Down

0 comments on commit df04e05

Please sign in to comment.