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;
16 import java.util.List;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.openhab.binding.lutron.internal.KeypadComponent;
20 import org.openhab.binding.lutron.internal.discovery.project.ComponentType;
23 * Keypad configuration definition for Tabletop seeTouch line
25 * @author Bob Adair - Initial contribution
28 public final class KeypadConfigGrafikEye extends KeypadConfig {
30 private enum Component implements KeypadComponent {
31 BUTTON1(70, "button1", "Button 1", ComponentType.BUTTON), // Scene button 1
32 BUTTON2(71, "button2", "Button 2", ComponentType.BUTTON), // Scene button 2
33 BUTTON3(76, "button3", "Button 3", ComponentType.BUTTON), // Scene button 3
34 BUTTON4(77, "button4", "Button 4", ComponentType.BUTTON), // Scene button 4
35 BUTTON5(83, "button5", "Button 5", ComponentType.BUTTON), // Scene button 5/Off
37 BUTTON10(38, "button10", "Button 10", ComponentType.BUTTON), // Col 1
38 BUTTON11(39, "button11", "Button 11", ComponentType.BUTTON), // Col 1
39 BUTTON12(40, "button12", "Button 12", ComponentType.BUTTON), // Col 1
40 LOWER1(41, "buttonlower1", "Lower button col 1", ComponentType.BUTTON), // Col 1 lower
41 RAISE1(47, "buttonraise1", "Raise button col 1", ComponentType.BUTTON), // Col 1 raise
43 BUTTON20(44, "button20", "Button 20", ComponentType.BUTTON), // Col 2
44 BUTTON21(45, "button21", "Button 21", ComponentType.BUTTON), // Col 2
45 BUTTON22(46, "button22", "Button 22", ComponentType.BUTTON), // Col 2
46 LOWER2(52, "buttonlower2", "Lower button col 2", ComponentType.BUTTON), // Col 2 lower
47 RAISE2(53, "buttonraise2", "Raise button col 2", ComponentType.BUTTON), // Col 2 raise
49 BUTTON30(50, "button30", "Button 30", ComponentType.BUTTON), // Col 3
50 BUTTON31(51, "button31", "Button 31", ComponentType.BUTTON), // Col 3
51 BUTTON32(56, "button32", "Button 32", ComponentType.BUTTON), // Col 3
52 LOWER3(57, "buttonlower3", "Lower button col 3", ComponentType.BUTTON), // Col 3 lower
53 RAISE3(58, "buttonraise3", "Raise button col 3", ComponentType.BUTTON), // Col 3 raise
55 CCI1(163, "cci1", "CCI 1", ComponentType.CCI),
57 LED1(201, "led1", "LED 1", ComponentType.LED), // Scene button LEDs
58 LED2(210, "led2", "LED 2", ComponentType.LED),
59 LED3(219, "led3", "LED 3", ComponentType.LED),
60 LED4(228, "led4", "LED 4", ComponentType.LED),
61 LED5(237, "led5", "LED 5", ComponentType.LED),
63 LED10(174, "led10", "LED 10", ComponentType.LED), // Col 1 LEDs
64 LED11(175, "led11", "LED 11", ComponentType.LED),
65 LED12(211, "led12", "LED 12", ComponentType.LED),
67 LED20(183, "led20", "LED 20", ComponentType.LED), // Col 2 LEDs
68 LED21(184, "led21", "LED 21", ComponentType.LED),
69 LED22(220, "led22", "LED 22", ComponentType.LED),
71 LED30(192, "led30", "LED 30", ComponentType.LED), // Col 3 LEDs
72 LED31(193, "led31", "LED 31", ComponentType.LED),
73 LED32(229, "led32", "LED 32", ComponentType.LED);
76 private final String channel;
77 private final String description;
78 private final ComponentType type;
80 Component(int id, String channel, String description, ComponentType type) {
82 this.channel = channel;
83 this.description = description;
93 public String channel() {
98 public String description() {
103 public ComponentType type() {
108 private static final List<KeypadComponent> SCENE_BUTTON_GROUP = Arrays.asList(Component.BUTTON1, Component.BUTTON2,
109 Component.BUTTON3, Component.BUTTON4, Component.BUTTON5);
110 private static final List<KeypadComponent> SCENE_LED_GROUP = Arrays.asList(Component.LED1, Component.LED2,
111 Component.LED3, Component.LED4, Component.LED5);
113 private static final List<KeypadComponent> CCI_GROUP = Arrays.asList(Component.CCI1);
115 private static final List<KeypadComponent> COL1_BUTTON_GROUP = Arrays.asList(Component.BUTTON10, Component.BUTTON11,
116 Component.BUTTON12, Component.LOWER1, Component.RAISE1);
117 private static final List<KeypadComponent> COL2_BUTTON_GROUP = Arrays.asList(Component.BUTTON20, Component.BUTTON21,
118 Component.BUTTON22, Component.LOWER2, Component.RAISE2);
119 private static final List<KeypadComponent> COL3_BUTTON_GROUP = Arrays.asList(Component.BUTTON30, Component.BUTTON31,
120 Component.BUTTON32, Component.LOWER3, Component.RAISE3);
122 private static final List<KeypadComponent> COL1_LED_GROUP = Arrays.asList(Component.LED10, Component.LED11,
124 private static final List<KeypadComponent> COL2_LED_GROUP = Arrays.asList(Component.LED20, Component.LED21,
126 private static final List<KeypadComponent> COL3_LED_GROUP = Arrays.asList(Component.LED30, Component.LED31,
130 public boolean isLed(int id) {
131 return (id >= 174 && id <= 237);
135 public boolean isButton(int id) {
136 return (id >= 38 && id <= 83);
140 public boolean isCCI(int id) {
144 public KeypadConfigGrafikEye() {
145 modelData.put("0COL", combinedList(SCENE_BUTTON_GROUP, CCI_GROUP, SCENE_LED_GROUP));
147 modelData.put("1COL",
148 combinedList(SCENE_BUTTON_GROUP, COL1_BUTTON_GROUP, CCI_GROUP, SCENE_LED_GROUP, COL1_LED_GROUP));
150 modelData.put("2COL", combinedList(SCENE_BUTTON_GROUP, COL1_BUTTON_GROUP, COL2_BUTTON_GROUP, CCI_GROUP,
151 SCENE_LED_GROUP, COL1_LED_GROUP, COL2_LED_GROUP));
153 modelData.put("3COL", combinedList(SCENE_BUTTON_GROUP, COL1_BUTTON_GROUP, COL2_BUTTON_GROUP, COL3_BUTTON_GROUP,
154 CCI_GROUP, SCENE_LED_GROUP, COL1_LED_GROUP, COL2_LED_GROUP, COL3_LED_GROUP));