]> git.basschouten.com Git - openhab-addons.git/blob
0d952bed37f1cf39c9697938bec891da2365f8fe
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 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 java.math.BigDecimal;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19
20 /**
21  * A user can add custom channels to an MQTT Thing.
22  * <p>
23  * This class contains the channel configuration.
24  * <p>
25  * You may want to extend this for channel configurations of MQTT extensions.
26  *
27  * @author David Graeff - Initial contribution
28  */
29 @NonNullByDefault
30 public class ChannelConfig {
31     /** This is either a state topic or a trigger topic, depending on {@link #trigger}. */
32     public String stateTopic = "";
33     public String commandTopic = "";
34
35     /**
36      * If true, the channel state is not updated on a new message.
37      * Instead a postCommand() call is performed.
38      */
39     public boolean postCommand = false;
40     public @Nullable Integer qos;
41     public boolean retained = false;
42     /** If true, the state topic will not update a state, but trigger a channel instead. */
43     public boolean trigger = false;
44     public String unit = "";
45
46     public String transformationPattern = "";
47     public String transformationPatternOut = "";
48     public String formatBeforePublish = "%s";
49     public String allowedStates = "";
50
51     public @Nullable BigDecimal min;
52     public @Nullable BigDecimal max;
53     public @Nullable BigDecimal step;
54     public @Nullable String on;
55     public @Nullable String off;
56     public @Nullable String stop;
57
58     public int onBrightness = 10;
59     public String colorMode = "";
60 }