]> git.basschouten.com Git - openhab-addons.git/blob
15d8ea4b6920b1dc9cfa9526de73e40538194048
[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.loxone.internal.controls;
14
15 import java.util.Collections;
16
17 import org.junit.jupiter.api.BeforeEach;
18 import org.junit.jupiter.api.Test;
19 import org.openhab.core.library.types.DecimalType;
20 import org.openhab.core.library.types.OnOffType;
21 import org.openhab.core.library.types.StringType;
22
23 /**
24  * Test class for (@link LxControlPushbutton}
25  *
26  * @author Pawel Pieczul - initial contribution
27  *
28  */
29 public class LxControlPushbuttonTest extends LxControlSwitchTest {
30     @Override
31     @BeforeEach
32     public void setup() {
33         setupControl("0e3684cc-026e-28e0-ffff403fb0c34b9e", "0b734138-038c-035e-ffff403fb0c34b9e",
34                 "0b734138-033e-02d8-ffff403fb0c34b9e", "Kitchen All Blinds Up");
35     }
36
37     @Override
38     @Test
39     public void testControlCreation() {
40         testControlCreation(LxControlPushbutton.class, 1, 0, 1, 1, 1);
41     }
42
43     @Override
44     @Test
45     public void testChannels() {
46         testChannel("Switch", Collections.singleton("Switchable"));
47     }
48
49     @Override
50     @Test
51     public void testCommands() {
52         for (int i = 0; i < 100; i++) {
53             executeCommand(OnOffType.ON);
54             testAction("Pulse");
55             executeCommand(DecimalType.ZERO);
56             testAction(null);
57             executeCommand(OnOffType.OFF);
58             testAction("Off");
59             executeCommand(StringType.EMPTY);
60             testAction(null);
61         }
62     }
63 }