2 * Copyright (c) 2010-2020 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.keypadconfig;
15 import java.util.Arrays;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.lutron.internal.KeypadComponent;
19 import org.openhab.binding.lutron.internal.discovery.project.ComponentType;
22 * Keypad configuration definition for Pico models
24 * @author Bob Adair - Initial contribution
27 public final class KeypadConfigPico extends KeypadConfig {
29 private static enum Component implements KeypadComponent {
30 // Buttons for 2B, 2BRL, 3B, and 3BRL models
31 BUTTON1(2, "button1", "Button 1", ComponentType.BUTTON),
32 BUTTON2(3, "button2", "Button 2", ComponentType.BUTTON),
33 BUTTON3(4, "button3", "Button 3", ComponentType.BUTTON),
35 RAISE(5, "buttonraise", "Raise Button", ComponentType.BUTTON),
36 LOWER(6, "buttonlower", "Lower Button", ComponentType.BUTTON),
38 // Buttons for PJ2-4B model
39 BUTTON1_4B(8, "button01", "Button 1", ComponentType.BUTTON),
40 BUTTON2_4B(9, "button02", "Button 2", ComponentType.BUTTON),
41 BUTTON3_4B(10, "button03", "Button 3", ComponentType.BUTTON),
42 BUTTON4_4B(11, "button04", "Button 4", ComponentType.BUTTON);
45 private final String channel;
46 private final String description;
47 private final ComponentType type;
49 Component(int id, String channel, String description, ComponentType type) {
51 this.channel = channel;
52 this.description = description;
62 public String channel() {
67 public String description() {
72 public ComponentType type() {
78 public boolean isLed(int id) {
83 public boolean isButton(int id) {
84 return (id >= 2 && id <= 11);
88 public boolean isCCI(int id) {
92 public KeypadConfigPico() {
93 modelData.put("2B", Arrays.asList(Component.BUTTON1, Component.BUTTON3));
94 modelData.put("2BRL", Arrays.asList(Component.BUTTON1, Component.BUTTON3, Component.RAISE, Component.LOWER));
95 modelData.put("3B", Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3));
96 modelData.put("3BRL", Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.RAISE,
99 Arrays.asList(Component.BUTTON1_4B, Component.BUTTON2_4B, Component.BUTTON3_4B, Component.BUTTON4_4B));