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.protocol;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.binding.lutron.internal.handler.LeapBridgeHandler;
18 import org.openhab.binding.lutron.internal.protocol.leap.LeapCommand;
19 import org.openhab.binding.lutron.internal.protocol.lip.LutronCommandType;
20 import org.openhab.binding.lutron.internal.protocol.lip.LutronOperation;
21 import org.openhab.binding.lutron.internal.protocol.lip.TargetType;
24 * Lutron SYSVAR command object
26 * @author Bob Adair - Initial contribution
29 public class SysvarCommand extends LutronCommandNew {
30 public static final Integer ACTION_GETSETSYSVAR = 1;
32 private final Integer action;
33 private final @Nullable Object parameter;
36 * SysvarCommand constructor
40 * @param integrationId
44 public SysvarCommand(LutronOperation operation, Integer integrationId, Integer action, @Nullable Object parameter) {
45 super(TargetType.SYSVAR, operation, LutronCommandType.SYSVAR, integrationId);
47 this.parameter = parameter;
51 public String lipCommand() {
52 StringBuilder builder = new StringBuilder().append(operation).append(commandType);
53 builder.append(',').append(integrationId);
54 builder.append(',').append(action);
55 if (parameter != null) {
56 builder.append(',').append(parameter);
59 return builder.toString();
63 public @Nullable LeapCommand leapCommand(LeapBridgeHandler bridgeHandler, @Nullable Integer leapZone) {
64 return null; // No equivalent LEAP command
68 public String toString() {