]> git.basschouten.com Git - openhab-addons.git/blob
606d4fee1c57dbb1631d92f7f3fda21803bcdf46
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.lutron.internal.keypadconfig;
14
15 import java.util.Arrays;
16
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;
20
21 /**
22  * Keypad configuration definition for International seeTouch line
23  *
24  * @author Bob Adair - Initial contribution
25  */
26 @NonNullByDefault
27 public final class KeypadConfigIntlSeetouch extends KeypadConfig {
28
29     private static 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),
37         BUTTON8(8, "button8", "Button 8", ComponentType.BUTTON),
38         BUTTON9(9, "button9", "Button 9", ComponentType.BUTTON),
39         BUTTON10(10, "button10", "Button 10", ComponentType.BUTTON),
40
41         LOWER1(18, "buttonlower", "Lower button", ComponentType.BUTTON),
42         RAISE1(19, "buttonraise", "Raise button", ComponentType.BUTTON),
43
44         CCI1(25, "cci1", "", ComponentType.CCI),
45         CCI2(26, "cci2", "", ComponentType.CCI),
46
47         LED1(81, "led1", "LED 1", ComponentType.LED),
48         LED2(82, "led2", "LED 2", ComponentType.LED),
49         LED3(83, "led3", "LED 3", ComponentType.LED),
50         LED4(84, "led4", "LED 4", ComponentType.LED),
51         LED5(85, "led5", "LED 5", ComponentType.LED),
52         LED6(86, "led6", "LED 6", ComponentType.LED),
53         LED7(87, "led7", "LED 7", ComponentType.LED),
54         LED8(88, "led8", "LED 8", ComponentType.LED),
55         LED9(89, "led9", "LED 9", ComponentType.LED),
56         LED10(90, "led10", "LED 10", ComponentType.LED);
57
58         private final int id;
59         private final String channel;
60         private final String description;
61         private final ComponentType type;
62
63         Component(int id, String channel, String description, ComponentType type) {
64             this.id = id;
65             this.channel = channel;
66             this.description = description;
67             this.type = type;
68         }
69
70         @Override
71         public int id() {
72             return id;
73         }
74
75         @Override
76         public String channel() {
77             return channel;
78         }
79
80         @Override
81         public String description() {
82             return description;
83         }
84
85         @Override
86         public ComponentType type() {
87             return type;
88         }
89     }
90
91     @Override
92     public boolean isLed(int id) {
93         return (id >= 81 && id <= 90);
94     }
95
96     @Override
97     public boolean isButton(int id) {
98         return ((id >= 1 && id <= 10) || (id >= 18 && id <= 19));
99     }
100
101     @Override
102     public boolean isCCI(int id) {
103         return (id >= 25 && id <= 26);
104     }
105
106     public KeypadConfigIntlSeetouch() {
107         modelData.put("2B", Arrays.asList(Component.BUTTON7, Component.BUTTON9, Component.LED7, Component.LED9,
108                 Component.CCI1, Component.CCI2));
109
110         modelData.put("3B", Arrays.asList(Component.BUTTON6, Component.BUTTON8, Component.BUTTON10, Component.LED6,
111                 Component.LED8, Component.LED10, Component.CCI1, Component.CCI2));
112
113         modelData.put("4B", Arrays.asList(Component.BUTTON2, Component.BUTTON4, Component.BUTTON7, Component.BUTTON9,
114                 Component.LED2, Component.LED4, Component.LED7, Component.LED9, Component.CCI1, Component.CCI2));
115
116         modelData.put("5BRL",
117                 Arrays.asList(Component.BUTTON6, Component.BUTTON7, Component.BUTTON8, Component.BUTTON9,
118                         Component.BUTTON10, Component.LOWER1, Component.RAISE1, Component.LED6, Component.LED7,
119                         Component.LED8, Component.LED9, Component.LED10, Component.CCI1, Component.CCI2));
120
121         modelData.put("6BRL",
122                 Arrays.asList(Component.BUTTON1, Component.BUTTON3, Component.BUTTON5, Component.BUTTON6,
123                         Component.BUTTON8, Component.BUTTON10, Component.LOWER1, Component.RAISE1, Component.LED1,
124                         Component.LED3, Component.LED5, Component.LED6, Component.LED8, Component.LED10, Component.CCI1,
125                         Component.CCI2));
126
127         modelData.put("7BRL",
128                 Arrays.asList(Component.BUTTON2, Component.BUTTON4, Component.BUTTON6, Component.BUTTON7,
129                         Component.BUTTON8, Component.BUTTON9, Component.BUTTON10, Component.LOWER1, Component.RAISE1,
130                         Component.LED2, Component.LED4, Component.LED6, Component.LED7, Component.LED8, Component.LED9,
131                         Component.LED10, Component.CCI1, Component.CCI2));
132
133         modelData.put("8BRL", Arrays.asList(Component.BUTTON1, Component.BUTTON3, Component.BUTTON5, Component.BUTTON6,
134                 Component.BUTTON7, Component.BUTTON8, Component.BUTTON9, Component.BUTTON10, Component.LOWER1,
135                 Component.RAISE1, Component.LED1, Component.LED3, Component.LED5, Component.LED6, Component.LED7,
136                 Component.LED8, Component.LED9, Component.LED10, Component.CCI1, Component.CCI2));
137
138         modelData.put("10BRL",
139                 Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON4,
140                         Component.BUTTON5, Component.BUTTON6, Component.BUTTON7, Component.BUTTON8, Component.BUTTON9,
141                         Component.BUTTON10, Component.LOWER1, Component.RAISE1, Component.LED1, Component.LED2,
142                         Component.LED3, Component.LED4, Component.LED5, Component.LED6, Component.LED7, Component.LED8,
143                         Component.LED9, Component.LED10, Component.CCI1, Component.CCI2));
144     }
145 }