]> git.basschouten.com Git - openhab-addons.git/blob
7785f992546ca21a0624115246b5233a379d1b51
[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.sensibo.internal.dto.poddetails;
14
15 import org.openhab.binding.sensibo.internal.SensiboTemperatureUnitConverter;
16 import org.openhab.binding.sensibo.internal.model.AcState;
17
18 /**
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.
21  *
22  * @author Arne Seime - Initial contribution.
23  */
24 public class AcStateDTO {
25     public boolean on;
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;
31
32     public AcStateDTO(boolean on, String fanLevel, String temperatureUnit, Integer targetTemperature, String mode,
33             String swing) {
34         this.on = on;
35         this.fanLevel = fanLevel;
36         this.temperatureUnit = temperatureUnit;
37         this.targetTemperature = targetTemperature;
38         this.mode = mode;
39         this.swing = swing;
40     }
41
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());
49     }
50 }