]> git.basschouten.com Git - openhab-addons.git/blob
5258e8d5fbe745485a9eb05b318eb9deb56c4866
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.atlona.internal;
14
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;
20
21 /**
22  *
23  * A callback to {@link org.openhab.binding.atlona.internal.handler.AtlonaHandler}
24  * that can be used to update the status, properties and state of the thing.
25  *
26  * @author Tim Roberts - Initial contribution
27  */
28 @NonNullByDefault
29 public interface AtlonaHandlerCallback {
30     /**
31      * Callback to the {@link org.openhab.binding.atlona.internal.handler.AtlonaHandler}
32      * to update the status of the thing.
33      *
34      * @param status a non-null {@link org.openhab.core.thing.ThingStatus}
35      * @param detail a non-null {@link org.openhab.core.thing.ThingStatusDetail}
36      * @param msg a possibly null, possibly empty message
37      */
38     void statusChanged(ThingStatus status, ThingStatusDetail detail, @Nullable String msg);
39
40     /**
41      * Callback to the {@link org.openhab.binding.atlona.internal.handler.AtlonaHandler}
42      * to update the state of an item
43      *
44      * @param channelId the non-null, non-empty channel id
45      * @param state the new non-null {@link State}
46      */
47     void stateChanged(String channelId, State state);
48
49     /**
50      * Callback to the {@link org.openhab.binding.atlona.internal.handler.AtlonaHandler}
51      * to update the property of a thing
52      *
53      * @param propertyName a non-null, non-empty property name
54      * @param propertyValue a non-null, possibly empty property value
55      */
56     void setProperty(String propertyName, String propertyValue);
57 }