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.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.thing.binding.ThingHandler;
20 import org.openhab.core.types.State;
24 * This interface is used to provide a callback mechanism between a @link {@link ThingHandler} and the assoicated
26 * This is necessary since the status and state of a bridge/thing is private and the protocol handler cannot access it
29 * @author Tim Roberts - initial contribution
33 public interface NeeoHandlerCallback {
35 * Callback to the bridge/thing to update the status of the bridge/thing.
37 * @param status a non-null {@link ThingStatus}
38 * @param detail a non-null {@link ThingStatusDetail}
39 * @param msg a possibly null, possibly empty message
41 void statusChanged(ThingStatus status, ThingStatusDetail detail, String msg);
44 * Callback to the bridge/thing to update the state of a channel in the bridge/thing.
46 * @param channelId the non-null, non-empty channel id
47 * @param state the new non-null {@State}
49 void stateChanged(String channelId, State state);
52 * Callback to set a property for the thing.
54 * @param propertyName a non-null, non-empty property name
55 * @param propertyValue a non-null, possibly empty property value
57 void setProperty(String propertyName, String propertyValue);
60 * Schedule a task to be executed in the future
62 * @param task the non-null task
63 * @param milliSeconds the milliseconds (>0)
65 void scheduleTask(Runnable task, long milliSeconds);
68 * Callback to trigger an event
70 * @param channelID a non-null, non-empty channel id
71 * @param event a possibly null, possibly empty event
73 void triggerEvent(String channelID, String event);
76 * Callback to retrieve the current {@link NeeoBrainApi}
78 * @return a possibly null {@link NeeoBrainApi}
81 NeeoBrainApi getApi();