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.loxone.internal.controls;
15 import org.junit.jupiter.api.BeforeEach;
16 import org.junit.jupiter.api.Test;
17 import org.openhab.core.library.types.DecimalType;
18 import org.openhab.core.library.types.OnOffType;
19 import org.openhab.core.library.types.PercentType;
20 import org.openhab.core.types.UnDefType;
23 * Test class for (@link LxControlSauna} - version with vaporizer and door sensor
25 * @author Pawel Pieczul - initial contribution
28 public class LxControlSaunaDoorVaporizerTest extends LxControlSaunaDoorTest {
32 setupControl("17452951-02ae-1b6e-ffff266cf17271dd", "0b734138-037d-034e-ffff403fb0c34b9e",
33 "0fe650c2-0004-d446-ffff504f9410790f", "Sauna Controller With Vaporizer With Door Sensor");
38 public void testControlCreation() {
39 testControlCreation(LxControlSauna.class, 3, 0, 18, 18, 21);
44 public void testChannels() {
46 testChannel("Number", VAPOR_POWER_CHANNEL);
47 testChannel("Switch", OUT_OF_WATER_CHANNEL);
48 testChannel("Number", ACTUAL_HUMIDITY_CHANNEL);
49 testChannel("Number", TARGET_HUMIDITY_CHANNEL);
50 testChannel("Number", EVAPORATOR_MODE_CHANNEL);
55 public void vaporPowerChannel() {
56 for (Double i = 0.0; i <= 100.0; i += 1.0) {
57 changeLoxoneState("vaporpower", i);
58 testChannelState(VAPOR_POWER_CHANNEL, new PercentType(i.intValue()));
60 changeLoxoneState("vaporpower", -1.0);
61 testChannelState(VAPOR_POWER_CHANNEL, UnDefType.UNDEF);
62 changeLoxoneState("vaporpower", 100.1);
63 testChannelState(VAPOR_POWER_CHANNEL, UnDefType.UNDEF);
68 public void testOutOfWaterChannel() {
69 for (int i = 0; i < 5; i++) {
70 changeLoxoneState("lesswater", 0.0);
71 testChannelState(OUT_OF_WATER_CHANNEL, OnOffType.OFF);
72 changeLoxoneState("lesswater", 1.0);
73 testChannelState(OUT_OF_WATER_CHANNEL, OnOffType.ON);
79 public void testActualHumidityChannel() {
80 for (Double i = 0.0; i <= 100.0; i += 0.17) {
81 changeLoxoneState("humidityactual", i);
82 testChannelState(ACTUAL_HUMIDITY_CHANNEL, new DecimalType(i));
88 public void testTargetHumidityChannel() {
89 for (Double i = 0.0; i <= 100.0; i += 0.17) {
90 changeLoxoneState("humiditytarget", i);
91 testChannelState(TARGET_HUMIDITY_CHANNEL, new DecimalType(i));
93 for (Double i = 0.0; i <= 100.0; i += 0.13) {
94 executeCommand(TARGET_HUMIDITY_CHANNEL, new DecimalType(i));
95 testAction("humidity/" + i.toString());
101 public void testEvaporatorModelChannel() {
102 for (Double i = 0.0; i <= 6.0; i += 1.0) {
103 changeLoxoneState("mode", i);
104 testChannelState(EVAPORATOR_MODE_CHANNEL, new DecimalType(i));
106 for (Double i = -10.0; i < 0.0; i += 0.4) {
107 executeCommand(EVAPORATOR_MODE_CHANNEL, new DecimalType(i));
110 for (Double i = 0.0; i < 6.0; i += 1.0) {
111 executeCommand(EVAPORATOR_MODE_CHANNEL, new DecimalType(i));
112 testAction("mode/" + i.toString());
114 for (Double i = 6.1; i < 15.0; i += 0.1) {
115 executeCommand(EVAPORATOR_MODE_CHANNEL, new DecimalType(i));
118 for (Double i = 0.3; i < 6.0; i += 1.0) {
119 executeCommand(EVAPORATOR_MODE_CHANNEL, new DecimalType(i));