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.model;
15 import javax.measure.Unit;
16 import javax.measure.quantity.Temperature;
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;
24 * Represents the state of the AC unit.
26 * @author Arne Seime - Initial contribution
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;
37 public AcState(final AcStateDTO dto) {
39 this.fanLevel = dto.fanLevel;
40 this.targetTemperature = dto.targetTemperature;
42 this.swing = dto.swing;
43 this.temperatureUnit = SensiboTemperatureUnitConverter.parseFromSensiboFormat(dto.temperatureUnit);
46 public boolean isOn() {
51 public String getFanLevel() {
56 public Unit<Temperature> getTemperatureUnit() {
57 return temperatureUnit;
61 public Integer getTargetTemperature() {
62 return targetTemperature;
66 public String getMode() {
71 public String getSwing() {