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.neeo.internal;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.core.thing.ThingStatus;
18 import org.openhab.core.thing.ThingStatusDetail;
19 import org.openhab.core.types.State;
23 * This interface is used to provide a callback mechanism between a {@link org.openhab.core.thing.binding.ThingHandler}
24 * and the associated protocol.
25 * This is necessary since the status and state of a bridge/thing is private and the protocol handler cannot access it
28 * @author Tim Roberts - Initial contribution
32 public interface NeeoHandlerCallback {
34 * Callback to the bridge/thing to update the status of the bridge/thing.
36 * @param status a non-null {@link ThingStatus}
37 * @param detail a non-null {@link ThingStatusDetail}
38 * @param msg a possibly null, possibly empty message
40 void statusChanged(ThingStatus status, ThingStatusDetail detail, String msg);
43 * Callback to the bridge/thing to update the state of a channel in the bridge/thing.
45 * @param channelId the non-null, non-empty channel id
46 * @param state the new non-null {@State}
48 void stateChanged(String channelId, State state);
51 * Callback to set a property for the thing.
53 * @param propertyName a non-null, non-empty property name
54 * @param propertyValue a non-null, possibly empty property value
56 void setProperty(String propertyName, String propertyValue);
59 * Schedule a task to be executed in the future
61 * @param task the non-null task
62 * @param milliSeconds the milliseconds (>0)
64 void scheduleTask(Runnable task, long milliSeconds);
67 * Callback to trigger an event
69 * @param channelID a non-null, non-empty channel id
70 * @param event a possibly null, possibly empty event
72 void triggerEvent(String channelID, String event);
75 * Callback to retrieve the current {@link NeeoBrainApi}
77 * @return a possibly null {@link NeeoBrainApi}
80 NeeoBrainApi getApi();