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.mqtt.generic;
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;
21 * @author David Graeff - Initial contribution
24 public interface ChannelStateUpdateListener {
26 * A new value got published on a configured MQTT topic associated with the given channel uid.
28 * @param channelUID The channel uid
29 * @param value The new value. Doesn't necessarily need to be different than the value before.
31 void updateChannelState(ChannelUID channelUID, State value);
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.
37 * @param channelUID The channel uid
38 * @param value The new value. Doesn't necessarily need to be different than the value before.
40 void postChannelCommand(ChannelUID channelUID, Command value);
43 * A new value got published on a configured MQTT topic associated with the given channel uid.
44 * The channel is of kind Trigger.
46 * @param channelUID The channel uid
47 * @param eventPayload The new value. Doesn't necessarily need to be different than the value before.
49 void triggerChannel(ChannelUID channelUID, String eventPayload);