]> git.basschouten.com Git - openhab-addons.git/blob
e3be410b27d7ff52f45ac3a33da4b5e3187e1840
[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.model;
14
15 import javax.measure.Unit;
16 import javax.measure.quantity.Temperature;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
20 import org.openhab.binding.sensibo.internal.SensiboTemperatureUnitConverter;
21 import org.openhab.binding.sensibo.internal.dto.poddetails.AcStateDTO;
22
23 /**
24  * Represents the state of the AC unit.
25  * 
26  * @author Arne Seime - Initial contribution
27  */
28 @NonNullByDefault
29 public class AcState {
30     private final boolean on;
31     private final @Nullable String fanLevel;
32     private final @Nullable Unit<Temperature> temperatureUnit;
33     private final @Nullable Integer targetTemperature;
34     private final @Nullable String mode;
35     private final @Nullable String swing;
36
37     public AcState(final AcStateDTO dto) {
38         this.on = dto.on;
39         this.fanLevel = dto.fanLevel;
40         this.targetTemperature = dto.targetTemperature;
41         this.mode = dto.mode;
42         this.swing = dto.swing;
43         this.temperatureUnit = SensiboTemperatureUnitConverter.parseFromSensiboFormat(dto.temperatureUnit);
44     }
45
46     public boolean isOn() {
47         return on;
48     }
49
50     @Nullable
51     public String getFanLevel() {
52         return fanLevel;
53     }
54
55     @Nullable
56     public Unit<Temperature> getTemperatureUnit() {
57         return temperatureUnit;
58     }
59
60     @Nullable
61     public Integer getTargetTemperature() {
62         return targetTemperature;
63     }
64
65     @Nullable
66     public String getMode() {
67         return mode;
68     }
69
70     @Nullable
71     public String getSwing() {
72         return swing;
73     }
74 }