]> git.basschouten.com Git - openhab-addons.git/blob
525d8c7b83b8226bcb951403d5065353a5a67350
[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.boschshc.internal.services.roomclimatecontrol.dto;
14
15 import javax.measure.quantity.Temperature;
16
17 import org.openhab.binding.boschshc.internal.services.dto.BoschSHCServiceState;
18 import org.openhab.core.library.types.QuantityType;
19 import org.openhab.core.library.unit.SIUnits;
20 import org.openhab.core.types.State;
21
22 /**
23  * State for {@link RoomClimateControlService} to get and set the desired temperature of a room.
24  * 
25  * @author Christian Oeing - Initial contribution
26  */
27 public class RoomClimateControlServiceState extends BoschSHCServiceState {
28
29     private static final String TYPE = "climateControlState";
30
31     public RoomClimateControlServiceState() {
32         super(TYPE);
33     }
34
35     /**
36      * Constructor.
37      * 
38      * @param setpointTemperature Desired temperature (in degree celsius).
39      */
40     public RoomClimateControlServiceState(double setpointTemperature) {
41         super(TYPE);
42         this.setpointTemperature = setpointTemperature;
43     }
44
45     /**
46      * Desired temperature (in degree celsius).
47      * 
48      * @apiNote Min: 5.0, Max: 30.0.
49      * @apiNote Can be set in 0.5 steps.
50      */
51     private double setpointTemperature;
52
53     /**
54      * Desired temperature state to set for a thing.
55      * 
56      * @return Desired temperature state to set for a thing.
57      */
58     public State getSetpointTemperatureState() {
59         return new QuantityType<Temperature>(this.setpointTemperature, SIUnits.CELSIUS);
60     }
61 }