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.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 seeTouch and Hybrid seeTouch
24 * @author Bob Adair - Initial contribution
27 public final class KeypadConfigSeetouch extends KeypadConfig {
29 private enum Component implements KeypadComponent {
30 BUTTON1(1, "button1", "Button 1", ComponentType.BUTTON),
31 BUTTON2(2, "button2", "Button 2", ComponentType.BUTTON),
32 BUTTON3(3, "button3", "Button 3", ComponentType.BUTTON),
33 BUTTON4(4, "button4", "Button 4", ComponentType.BUTTON),
34 BUTTON5(5, "button5", "Button 5", ComponentType.BUTTON),
35 BUTTON6(6, "button6", "Button 6", ComponentType.BUTTON),
36 BUTTON7(7, "button7", "Button 7", ComponentType.BUTTON),
38 LOWER1(16, "buttontoplower", "Top lower button", ComponentType.BUTTON),
39 RAISE1(17, "buttontopraise", "Top raise button", ComponentType.BUTTON),
40 LOWER2(18, "buttonbottomlower", "Bottom lower button", ComponentType.BUTTON),
41 RAISE2(19, "buttonbottomraise", "Bottom raise button", ComponentType.BUTTON),
43 // CCI1(25, "cci1", "CCI 1", ComponentType.CCI), // listed in spec but currently unused in binding
44 // CCI2(26, "cci2", "CCI 2", ComponentType.CCI), // listed in spec but currently unused in binding
46 LED1(81, "led1", "LED 1", ComponentType.LED),
47 LED2(82, "led2", "LED 2", ComponentType.LED),
48 LED3(83, "led3", "LED 3", ComponentType.LED),
49 LED4(84, "led4", "LED 4", ComponentType.LED),
50 LED5(85, "led5", "LED 5", ComponentType.LED),
51 LED6(86, "led6", "LED 6", ComponentType.LED),
52 LED7(87, "led7", "LED 7", ComponentType.LED);
55 private final String channel;
56 private final String description;
57 private final ComponentType type;
59 Component(int id, String channel, String description, ComponentType type) {
61 this.channel = channel;
62 this.description = description;
72 public String channel() {
77 public String description() {
82 public ComponentType type() {
88 public boolean isLed(int id) {
89 return (id >= 81 && id <= 87);
93 public boolean isButton(int id) {
94 return ((id >= 1 && id <= 7) || (id >= 16 && id <= 19));
98 public boolean isCCI(int id) {
102 public KeypadConfigSeetouch() {
103 modelData.put("W1RLD",
104 Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON5,
105 Component.BUTTON6, Component.LOWER2, Component.RAISE2, Component.LED1, Component.LED2,
106 Component.LED3, Component.LED5, Component.LED6));
108 modelData.put("W2RLD",
109 Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON5, Component.BUTTON6,
110 Component.LOWER1, Component.RAISE1, Component.LOWER2, Component.RAISE2, Component.LED1,
111 Component.LED2, Component.LED5, Component.LED6));
113 modelData.put("W3S", Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON6,
114 Component.LOWER2, Component.RAISE2, Component.LED1, Component.LED2, Component.LED3, Component.LED6));
116 modelData.put("W3BD",
117 Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON5,
118 Component.BUTTON6, Component.BUTTON7, Component.LED1, Component.LED2, Component.LED3,
119 Component.LED5, Component.LED6, Component.LED7));
121 modelData.put("W3BRL", Arrays.asList(Component.BUTTON2, Component.BUTTON3, Component.BUTTON4, Component.LOWER2,
122 Component.RAISE2, Component.LED2, Component.LED3, Component.LED4));
124 modelData.put("W3BSRL", Arrays.asList(Component.BUTTON1, Component.BUTTON3, Component.BUTTON5, Component.LOWER2,
125 Component.RAISE2, Component.LED1, Component.LED3, Component.LED5));
128 Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON4,
129 Component.BUTTON6, Component.LOWER2, Component.RAISE2, Component.LED1, Component.LED2,
130 Component.LED3, Component.LED4, Component.LED6));
132 modelData.put("W5BRL",
133 Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON4,
134 Component.BUTTON5, Component.LOWER2, Component.RAISE2, Component.LED1, Component.LED2,
135 Component.LED3, Component.LED4, Component.LED5));
137 modelData.put("W6BRL",
138 Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON4,
139 Component.BUTTON5, Component.BUTTON6, Component.LOWER2, Component.RAISE2, Component.LED1,
140 Component.LED2, Component.LED3, Component.LED4, Component.LED5, Component.LED6));
143 Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON4,
144 Component.BUTTON5, Component.BUTTON6, Component.BUTTON7, Component.LED1, Component.LED2,
145 Component.LED3, Component.LED4, Component.LED5, Component.LED6, Component.LED7));
147 modelData.put("Generic",
148 Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON4,
149 Component.BUTTON5, Component.BUTTON6, Component.BUTTON7, Component.LOWER1, Component.RAISE1,
150 Component.LOWER2, Component.RAISE2, Component.LED1, Component.LED2, Component.LED3,
151 Component.LED4, Component.LED5, Component.LED6, Component.LED7));