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.IncreaseDecreaseType;
18 import org.openhab.core.library.types.PercentType;
21 * Test class for (@link LxControlValueSelector} - version which allows for increasing only
23 * @author Pawel Pieczul - initial contribution
26 public class LxControlValueSelectorIncrTest extends LxControlValueSelectorTest {
30 setupControl("132a7b7e-0022-3aac-ffff403fb0c34b9e", "0b734138-037d-034e-ffff403fb0c34b9e",
31 "0fe650c2-0004-d446-ffff504f9410790f", "Selection Switch Increase Only");
36 public void testIncreaseDecreaseCommands() {
37 changeLoxoneState("min", 123.0);
38 changeLoxoneState("max", 456.0);
39 changeLoxoneState("step", 23.0);
40 changeLoxoneState("value", 400.0);
41 testChannelState(new PercentType(83));
42 executeCommand(IncreaseDecreaseType.INCREASE);
44 changeLoxoneState("value", 423.0);
45 testChannelState(new PercentType(90));
46 executeCommand(IncreaseDecreaseType.INCREASE);
48 changeLoxoneState("value", 446.0);
49 testChannelState(new PercentType(96));
50 executeCommand(IncreaseDecreaseType.INCREASE);
51 testAction("456.0"); // trim to max
52 changeLoxoneState("value", 456.0);
53 testChannelState(PercentType.HUNDRED);
54 executeCommand(IncreaseDecreaseType.DECREASE);
56 changeLoxoneState("step", 100.0);
57 executeCommand(IncreaseDecreaseType.DECREASE);
59 changeLoxoneState("value", 123.0);
60 testChannelState(PercentType.ZERO);