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 java.math.BigDecimal;
16 import java.util.ArrayList;
17 import java.util.List;
19 import org.junit.jupiter.api.BeforeEach;
20 import org.junit.jupiter.api.Test;
21 import org.openhab.core.library.types.DecimalType;
22 import org.openhab.core.library.types.OnOffType;
23 import org.openhab.core.types.StateOption;
26 * Test class for (@link LxControlRadio} - variant with 'all off' selection
28 * @author Pawel Pieczul - initial contribution
31 public class LxControlRadioTest2 extends LxControlRadioTest {
35 setupControl("1255054f-0355-af47-ffff403fb0c34b9e", "11d68cf4-0080-7697-ffff403fb0c34b9e",
36 "0fe650c2-0004-d446-ffff504f9410790f", "Sprinkler 2");
41 public void testChannels() {
42 List<StateOption> opts = new ArrayList<>();
43 for (Integer i = 1; i <= 6; i++) {
44 opts.add(new StateOption(i.toString(), "Sprinkler " + i.toString()));
46 opts.add(new StateOption("0", "All Off"));
47 testChannel("Number", null, BigDecimal.ZERO, new BigDecimal(16), BigDecimal.ONE, null, false, opts);
52 public void testLoxoneZeroIndexChanges() {
53 changeLoxoneState("activeoutput", 0.0);
54 testChannelState(new DecimalType(0));
59 public void testZeroIndexCommands() {
60 executeCommand(DecimalType.ZERO);
62 executeCommand(OnOffType.OFF);