2 * Copyright (c) 2010-2024 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.handler;
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.KeypadConfigPico;
19 import org.openhab.core.thing.Thing;
20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory;
24 * Handler responsible for communicating with Lutron Pico keypads
26 * @author Bob Adair - Initial contribution
29 public class PicoKeypadHandler extends BaseKeypadHandler {
31 private final Logger logger = LoggerFactory.getLogger(PicoKeypadHandler.class);
33 public PicoKeypadHandler(Thing thing) {
35 kp = new KeypadConfigPico();
39 protected void configureComponents(@Nullable String model) {
40 String mod = model == null ? "Generic" : model;
41 logger.debug("Configuring components for keypad model {}", mod);
45 buttonList = kp.getComponents(mod, ComponentType.BUTTON);
46 leapButtonMap = KeypadConfigPico.LEAPBUTTONS_2B;
49 buttonList = kp.getComponents(mod, ComponentType.BUTTON);
50 leapButtonMap = KeypadConfigPico.LEAPBUTTONS_2BRL;
53 buttonList = kp.getComponents(mod, ComponentType.BUTTON);
54 leapButtonMap = KeypadConfigPico.LEAPBUTTONS_3B;
57 buttonList = kp.getComponents(mod, ComponentType.BUTTON);
58 leapButtonMap = KeypadConfigPico.LEAPBUTTONS_4B;
61 logger.warn("No valid keypad model defined ({}). Assuming model 3BRL.", mod);
65 buttonList = kp.getComponents("3BRL", ComponentType.BUTTON);
66 leapButtonMap = KeypadConfigPico.LEAPBUTTONS_3BRL;