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.lutron.internal.radiora.protocol;
15 import java.util.ArrayList;
16 import java.util.List;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
20 import org.openhab.core.library.types.OnOffType;
23 * Set Switch Level (SSL)
24 * Turn an individual Switch ON or OFF.
26 * @author Jeff Lauterbach - Initial Contribution
30 public class SetSwitchLevelCommand extends RadioRACommand {
32 private int zoneNumber; // 1 to 32
33 private OnOffType state; // ON/OFF
34 private @Nullable Integer delaySec; // 0 to 240 (optional)
35 private int system; // 1 or 2, or 0 for none
37 public SetSwitchLevelCommand(int zoneNumber, OnOffType state, int system) {
38 this.zoneNumber = zoneNumber;
43 public void setDelaySeconds(int seconds) {
44 this.delaySec = seconds;
48 public String getCommand() {
53 public List<String> getArgs() {
54 List<String> args = new ArrayList<>();
55 args.add(String.valueOf(zoneNumber));
56 args.add(String.valueOf(state));
58 if (delaySec != null) {
59 args.add(String.valueOf(delaySec));
62 if (system == 1 || system == 2) {
63 args.add("S" + system);