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.OnOffType;
20 * Test class for (@link LxControlAlarm} - version with motion sensors
22 * @author Pawel Pieczul - initial contribution
25 public class LxControlAlarmWithPresenceTest extends LxControlAlarmNoPresenceTest {
26 private static final String MOTION_SENSORS_CHANNEL = " / Motion Sensors";
31 setupControl("133d5db0-0333-5865-ffff403fb0c34b9e", "0b734138-037d-034e-ffff403fb0c34b9e",
32 "0fe650c2-0004-d446-ffff504f9410790f", "Burglar Alarm With Presence");
37 public void testControlCreation() {
38 testControlCreation(LxControlAlarm.class, 2, 1, 12, 13, 10);
43 public void testChannels() {
45 testChannel("Switch", MOTION_SENSORS_CHANNEL);
50 public void testCommandsDefaultChannel() {
52 for (int i = 0; i < 20; i++) {
53 changeLoxoneState("disabledmove", 0.0);
54 executeCommand(OnOffType.ON);
56 executeCommand(OnOffType.OFF);
58 changeLoxoneState("disabledmove", 1.0);
59 executeCommand(OnOffType.ON);
61 executeCommand(OnOffType.OFF);
68 public void testCommandsArmWithDelayChannel() {
70 for (int i = 0; i < 20; i++) {
71 changeLoxoneState("disabledmove", 0.0);
72 executeCommand(ARM_DELAYED_CHANNEL, OnOffType.ON);
73 testAction("delayedon/1");
74 executeCommand(ARM_DELAYED_CHANNEL, OnOffType.OFF);
76 changeLoxoneState("disabledmove", 1.0);
77 executeCommand(ARM_DELAYED_CHANNEL, OnOffType.ON);
78 testAction("delayedon/0");
79 executeCommand(ARM_DELAYED_CHANNEL, OnOffType.OFF);
85 public void testCommandsMotionSensors() {
87 for (int i = 0; i < 20; i++) {
88 executeCommand(MOTION_SENSORS_CHANNEL, OnOffType.ON);
89 testAction("dismv/0");
90 executeCommand(MOTION_SENSORS_CHANNEL, OnOffType.OFF);
91 testAction("dismv/1");
96 public void testLoxoneMotionSensorsChanges() {
97 for (int i = 0; i < 20; i++) {
98 changeLoxoneState("disabledmove", 1.0);
99 testChannelState(MOTION_SENSORS_CHANNEL, OnOffType.OFF);
100 changeLoxoneState("disabledmove", 0.0);
101 testChannelState(MOTION_SENSORS_CHANNEL, OnOffType.ON);