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.sensibo.internal.dto.poddetails;
15 import org.openhab.binding.sensibo.internal.SensiboTemperatureUnitConverter;
16 import org.openhab.binding.sensibo.internal.model.AcState;
19 * All classes in the ..binding.sensibo.dto are data transfer classes used by the GSON mapper. This class reflects a
20 * part of a request/response data structure.
22 * @author Arne Seime - Initial contribution.
24 public class AcStateDTO {
26 public final String fanLevel;
27 public final String temperatureUnit;
28 public final Integer targetTemperature;
29 public final String mode;
30 public final String swing;
32 public AcStateDTO(boolean on, String fanLevel, String temperatureUnit, Integer targetTemperature, String mode,
35 this.fanLevel = fanLevel;
36 this.temperatureUnit = temperatureUnit;
37 this.targetTemperature = targetTemperature;
42 public AcStateDTO(AcState acState) {
43 this.on = acState.isOn();
44 this.fanLevel = acState.getFanLevel();
45 this.targetTemperature = acState.getTargetTemperature();
46 this.mode = acState.getMode();
47 this.swing = acState.getSwing();
48 this.temperatureUnit = SensiboTemperatureUnitConverter.toSensiboFormat(acState.getTemperatureUnit());