]> git.basschouten.com Git - openhab-addons.git/blob
863a3edc5fbcedc7991c0f9358d3efab0a87abaf
[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 seeTouch and Hybrid seeTouch
23  *
24  * @author Bob Adair - Initial contribution
25  */
26 @NonNullByDefault
27 public final class KeypadConfigSeetouch extends KeypadConfig {
28
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),
37
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),
42
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
45
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);
53
54         private final int id;
55         private final String channel;
56         private final String description;
57         private final ComponentType type;
58
59         Component(int id, String channel, String description, ComponentType type) {
60             this.id = id;
61             this.channel = channel;
62             this.description = description;
63             this.type = type;
64         }
65
66         @Override
67         public int id() {
68             return id;
69         }
70
71         @Override
72         public String channel() {
73             return channel;
74         }
75
76         @Override
77         public String description() {
78             return description;
79         }
80
81         @Override
82         public ComponentType type() {
83             return type;
84         }
85     }
86
87     @Override
88     public boolean isLed(int id) {
89         return (id >= 81 && id <= 87);
90     }
91
92     @Override
93     public boolean isButton(int id) {
94         return ((id >= 1 && id <= 7) || (id >= 16 && id <= 19));
95     }
96
97     @Override
98     public boolean isCCI(int id) {
99         return false;
100     }
101
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));
107
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));
112
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));
115
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));
120
121         modelData.put("W3BRL", Arrays.asList(Component.BUTTON2, Component.BUTTON3, Component.BUTTON4, Component.LOWER2,
122                 Component.RAISE2, Component.LED2, Component.LED3, Component.LED4));
123
124         modelData.put("W3BSRL", Arrays.asList(Component.BUTTON1, Component.BUTTON3, Component.BUTTON5, Component.LOWER2,
125                 Component.RAISE2, Component.LED1, Component.LED3, Component.LED5));
126
127         modelData.put("W4S",
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));
131
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));
136
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));
141
142         modelData.put("W7B",
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));
146
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));
152     }
153 }