2 * Copyright (c) 2010-2022 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;
22 * Set Dimmer Level (SDL)
23 * Set an individual Dimmer’s light level.
25 * @author Jeff Lauterbach - Initial Contribution
29 public class SetDimmerLevelCommand extends RadioRACommand {
31 private int zoneNumber; // 1 to 32
32 private int dimmerLevel; // 0 to 100
33 private @Nullable Integer fadeSec; // 0 to 240 (optional)
34 private int system; // 1 or 2, or 0 for none
36 public SetDimmerLevelCommand(int zoneNumber, int dimmerLevel, int system) {
37 this.zoneNumber = zoneNumber;
38 this.dimmerLevel = dimmerLevel;
42 public void setFadeSeconds(int seconds) {
47 public String getCommand() {
52 public List<String> getArgs() {
53 List<String> args = new ArrayList<>();
54 args.add(String.valueOf(zoneNumber));
55 args.add(String.valueOf(dimmerLevel));
57 if (fadeSec != null) {
58 args.add(String.valueOf(fadeSec));
61 if (system == 1 || system == 2) {
62 args.add("S" + String.valueOf(system));