2 * Copyright (c) 2010-2020 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.radiora.handler;
15 import org.openhab.binding.lutron.internal.radiora.protocol.RadioRAFeedback;
16 import org.openhab.core.thing.Bridge;
17 import org.openhab.core.thing.Thing;
18 import org.openhab.core.thing.ThingStatus;
19 import org.openhab.core.thing.ThingStatusDetail;
20 import org.openhab.core.thing.binding.BaseThingHandler;
21 import org.openhab.core.thing.binding.ThingHandler;
24 * Base class for non bridge handlers for Lutron RadioRA devices
26 * @author Jeff Lauterbach - Initial Contribution
29 public abstract class LutronHandler extends BaseThingHandler {
31 public LutronHandler(Thing thing) {
35 public RS232Handler getRS232Handler() {
36 Bridge bridge = getBridge();
38 updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED, "Unable to get bridge");
41 ThingHandler th = bridge.getHandler();
42 if (th instanceof RS232Handler) {
43 return (RS232Handler) th;
45 updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Bridge not properly configured.");
50 public abstract void handleFeedback(RadioRAFeedback feedback);