]> git.basschouten.com Git - openhab-addons.git/blob
38d6d3ffe14c73f0b837616c98895f96d519d6f6
[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.handler;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.binding.lutron.internal.discovery.project.ComponentType;
18 import org.openhab.binding.lutron.internal.keypadconfig.KeypadConfigGrafikEye;
19 import org.openhab.core.thing.Thing;
20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory;
22
23 /**
24  * Handler responsible for communicating with GRAFIK Eye QS devices in
25  * a RadioRA 2 or HomeWorks QS System.
26  *
27  * Does not communicate with the scene controller, timeclock controller, or wireless
28  * and EcoSystem occupancy sensors.
29  *
30  * @author Bob Adair - Initial contribution
31  */
32 @NonNullByDefault
33 public class GrafikEyeKeypadHandler extends BaseKeypadHandler {
34
35     private final Logger logger = LoggerFactory.getLogger(GrafikEyeKeypadHandler.class);
36
37     @Override
38     protected void configureComponents(@Nullable String model) {
39         String mod = model == null ? "3COL" : model;
40         logger.debug("Configuring components for GRAFIK Eye QS");
41
42         switch (mod) {
43             case "3COL":
44             case "2COL":
45             case "1COL":
46             case "0COL":
47                 buttonList = kp.getComponents(mod, ComponentType.BUTTON);
48                 ledList = kp.getComponents(mod, ComponentType.LED);
49                 cciList = kp.getComponents(mod, ComponentType.CCI);
50                 break;
51             default:
52                 logger.warn("No valid keypad model defined ({}). Assuming model 3COL.", mod);
53                 buttonList = kp.getComponents("3COL", ComponentType.BUTTON);
54                 ledList = kp.getComponents("3COL", ComponentType.LED);
55                 cciList = kp.getComponents("3COL", ComponentType.CCI);
56                 break;
57         }
58     }
59
60     public GrafikEyeKeypadHandler(Thing thing) {
61         super(thing);
62         kp = new KeypadConfigGrafikEye();
63     }
64 }