2 * Copyright (c) 2010-2022 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.OnOffType;
18 import org.openhab.core.types.UnDefType;
21 * Test class for (@link LxControlInfoOnlyDigital}
23 * @author Pawel Pieczul - initial contribution
26 public class LxControlInfoOnlyDigitalTest extends LxControlTest {
29 setupControl("101b50f7-0306-98fb-ffff403fb0c34b9e", "0e368d32-014f-4604-ffff403fb0c34b9e",
30 "101b563d-0302-78bd-ffff403fb0c34b9e", "Info Only Digital");
34 public void testControlCreation() {
35 testControlCreation(LxControlInfoOnlyDigital.class, 1, 0, 1, 1, 1);
39 public void testChannels() {
40 testChannel("Switch");
44 public void testLoxoneStateChanges() {
45 for (Double i = 2.0; i < 100.0; i++) {
46 changeLoxoneState("active", 0.0);
47 testChannelState(OnOffType.OFF);
48 changeLoxoneState("active", 1.0);
49 testChannelState(OnOffType.ON);
50 changeLoxoneState("active", 1.0 / i);
51 testChannelState(UnDefType.UNDEF);