2 * Copyright (c) 2010-2023 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.russound.internal.rio;
15 import org.openhab.core.thing.ThingStatus;
16 import org.openhab.core.thing.ThingStatusDetail;
17 import org.openhab.core.types.State;
21 * This interface is used to provide a callback mechanism between {@link AbstractRioProtocol} and the associated
22 * bridge/thing ({@link AbstractBridgeHandler} and {@link AbstractThingHandler}). This is necessary since the status and
23 * state of a bridge/thing is private and the protocol handler cannot access it directly.
25 * @author Tim Roberts - Initial contribution
27 public interface RioHandlerCallback {
29 * Callback to the bridge/thing to update the status of the bridge/thing.
31 * @param status a non-null {@link ThingStatus}
32 * @param detail a non-null {@link ThingStatusDetail}
33 * @param msg a possibly null, possibly empty message
35 void statusChanged(ThingStatus status, ThingStatusDetail detail, String msg);
38 * Callback to the bridge/thing to update the state of a channel in the bridge/thing.
40 * @param channelId the non-null, non-empty channel id
41 * @param state the new non-null {@link State}
43 void stateChanged(String channelId, State state);
46 * Callback to set a property for the thing
48 * @param propertyName a non-null, non-empty property name
49 * @param propertyValue a non-null, possibly empty property value
51 void setProperty(String propertyName, String propertyValue);
54 * Adds a listener to changes to the channelId
56 * @param channelId a non-null, non-empty channelID
57 * @param listener a non-null listener
58 * @throws IllegalArgumentException if channelId is null or empty
59 * @throws IllegalArgumentException if listener is null
61 void addListener(String channelId, RioHandlerCallbackListener listener);
64 * Removes the specified listener for the specified channel
66 * @param channelId a non-null, non-empty channelID
67 * @param listener a non-null listener
68 * @throws IllegalArgumentException if channelId is null or empty
69 * @throws IllegalArgumentException if listener is null
71 void removeListener(String channelId, RioHandlerCallbackListener listener);