2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.boschshc.internal.services.roomclimatecontrol.dto;
15 import javax.measure.quantity.Temperature;
17 import org.eclipse.jdt.annotation.NonNull;
18 import org.openhab.binding.boschshc.internal.services.dto.BoschSHCServiceState;
19 import org.openhab.binding.boschshc.internal.services.roomclimatecontrol.RoomClimateControlService;
20 import org.openhab.core.library.types.QuantityType;
21 import org.openhab.core.library.unit.SIUnits;
22 import org.openhab.core.types.State;
25 * State for {@link RoomClimateControlService} to get and set the desired temperature of a room.
27 * @author Christian Oeing - Initial contribution
29 public class RoomClimateControlServiceState extends BoschSHCServiceState {
31 private static final String CLIMATE_CONTROL_STATE_TYPE = "climateControlState";
33 public RoomClimateControlServiceState() {
34 super(CLIMATE_CONTROL_STATE_TYPE);
40 * @param setpointTemperature Desired temperature (in degree celsius).
42 public RoomClimateControlServiceState(double setpointTemperature) {
43 super(CLIMATE_CONTROL_STATE_TYPE);
44 this.setpointTemperature = setpointTemperature;
48 * Desired temperature (in degree celsius).
50 * @apiNote Min: 5.0, Max: 30.0.
51 * @apiNote Can be set in 0.5 steps.
53 private double setpointTemperature;
56 * Desired temperature state to set for a thing.
58 * @return Desired temperature state to set for a thing.
60 public State getSetpointTemperatureState() {
61 return new QuantityType<@NonNull Temperature>(this.setpointTemperature, SIUnits.CELSIUS);