]> git.basschouten.com Git - openhab-addons.git/blob
528dc49cb3588fee9c67e1904d76057d4207a740
[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.mqtt.generic;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.thing.ChannelUID;
17 import org.openhab.core.types.Command;
18 import org.openhab.core.types.State;
19
20 /**
21  * @author David Graeff - Initial contribution
22  */
23 @NonNullByDefault
24 public interface ChannelStateUpdateListener {
25     /**
26      * A new value got published on a configured MQTT topic associated with the given channel uid.
27      *
28      * @param channelUID The channel uid
29      * @param value The new value. Doesn't necessarily need to be different than the value before.
30      */
31     void updateChannelState(ChannelUID channelUID, State value);
32
33     /**
34      * A new value got published on a configured MQTT topic associated with the given channel uid.
35      * The channel is configured to post the new state as command.
36      *
37      * @param channelUID The channel uid
38      * @param value The new value. Doesn't necessarily need to be different than the value before.
39      */
40     void postChannelCommand(ChannelUID channelUID, Command value);
41
42     /**
43      * A new value got published on a configured MQTT topic associated with the given channel uid.
44      * The channel is of kind Trigger.
45      *
46      * @param channelUID The channel uid
47      * @param eventPayload The new value. Doesn't necessarily need to be different than the value before.
48      */
49     void triggerChannel(ChannelUID channelUID, String eventPayload);
50 }