]> git.basschouten.com Git - openhab-addons.git/blob
7a4168c08f5f17c6685b6f5a0f4b8d32decb14e9
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.evohome.internal.api.models.v2.dto.request;
14
15 import com.google.gson.annotations.SerializedName;
16
17 /**
18  * Request model for the mode
19  *
20  * @author Jasper van Zuijlen - Initial contribution
21  *
22  */
23 public class HeatSetPoint {
24
25     /**
26      * Constructs an override reset
27      */
28     HeatSetPoint() {
29         heatSetpointValue = 0.0;
30         setpointMode = "FollowSchedule";
31         timeUntil = null;
32     }
33
34     /**
35      * Constructs a permanent override with the given temperature
36      *
37      * @param setPoint The target temperature to set the set point to
38      */
39     HeatSetPoint(double setPoint) {
40         // Make sure that the value is rounded toward the nearest 0.5
41         heatSetpointValue = Math.round(setPoint * 2) / 2.0;
42         setpointMode = "PermanentOverride";
43         timeUntil = null;
44     }
45
46     @SuppressWarnings("unused")
47     @SerializedName("heatSetpointValue")
48     private double heatSetpointValue;
49
50     @SuppressWarnings("unused")
51     @SerializedName("setpointMode")
52     private String setpointMode;
53
54     @SuppressWarnings("unused")
55     @SerializedName("timeUntil")
56     private String timeUntil;
57 }