]> git.basschouten.com Git - openhab-addons.git/blob
8cb78dc7242a761dd8a6cddc73b1270cbe3d1a17
[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.lcn.internal.subhandler;
14
15 import java.util.Collection;
16 import java.util.regex.Matcher;
17 import java.util.regex.Pattern;
18
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.openhab.binding.lcn.internal.common.DimmerOutputCommand;
21 import org.openhab.binding.lcn.internal.common.LcnChannelGroup;
22 import org.openhab.binding.lcn.internal.common.LcnException;
23 import org.openhab.core.library.types.DecimalType;
24 import org.openhab.core.library.types.HSBType;
25 import org.openhab.core.library.types.OnOffType;
26 import org.openhab.core.library.types.PercentType;
27 import org.openhab.core.library.types.StopMoveType;
28 import org.openhab.core.library.types.StringType;
29 import org.openhab.core.library.types.UpDownType;
30
31 /**
32  * Interface for LCN module Thing sub handlers processing variables.
33  *
34  * @author Fabian Wolter - Initial contribution
35  */
36 @NonNullByDefault
37 public interface ILcnModuleSubHandler {
38     /**
39      * Gets the Patterns, the sub handler is capable to process.
40      *
41      * @return the Patterns
42      */
43     Collection<Pattern> getPckStatusMessagePatterns();
44
45     /**
46      * Processes the payload of a pre-matched PCK message.
47      *
48      * @param matcher the pre-matched matcher.
49      * @throws LcnException when the message cannot be processed
50      */
51     void handleStatusMessage(Matcher matcher) throws LcnException;
52
53     /**
54      * Processes a refresh request from openHAB.
55      *
56      * @param channelGroup the Channel group that shall be refreshed
57      * @param number the Channel number within the Channel group
58      */
59     void handleRefresh(LcnChannelGroup channelGroup, int number);
60
61     /**
62      * Processes a refresh request from openHAB.
63      *
64      * @param groupId the Channel ID that shall be refreshed
65      */
66     void handleRefresh(String groupId);
67
68     /**
69      * Handles a Command from openHAB.
70      *
71      * @param command the command to handle
72      * @param channelGroup the addressed Channel group
73      * @param number the Channel's number within the Channel group
74      * @throws LcnException when the command could not processed
75      */
76     void handleCommandOnOff(OnOffType command, LcnChannelGroup channelGroup, int number) throws LcnException;
77
78     /**
79      * Handles a Command from openHAB.
80      *
81      * @param command the command to handle
82      * @param channelGroup the addressed Channel group
83      * @param number the Channel's number within the Channel group
84      * @throws LcnException when the command could not processed
85      */
86     void handleCommandPercent(PercentType command, LcnChannelGroup channelGroup, int number) throws LcnException;
87
88     /**
89      * Handles a Command from openHAB.
90      *
91      * @param command the command to handle
92      * @param channelGroup the addressed Channel group
93      * @param idWithoutGroup the Channel's name within the Channel group
94      * @throws LcnException when the command could not processed
95      */
96     void handleCommandPercent(PercentType command, LcnChannelGroup channelGroup, String idWithoutGroup)
97             throws LcnException;
98
99     /**
100      * Handles a Command from openHAB.
101      *
102      * @param command the command to handle
103      * @param channelGroup the addressed Channel group
104      * @param number the Channel's number within the Channel group
105      * @throws LcnException when the command could not processed
106      */
107     void handleCommandDecimal(DecimalType command, LcnChannelGroup channelGroup, int number) throws LcnException;
108
109     /**
110      * Handles a Command from openHAB.
111      *
112      * @param command the command to handle
113      * @param number the Channel's number within the Channel group
114      * @throws LcnException when the command could not processed
115      */
116     void handleCommandDimmerOutput(DimmerOutputCommand command, int number) throws LcnException;
117
118     /**
119      * Handles a Command from openHAB.
120      *
121      * @param command the command to handle
122      * @param number the Channel's number within the Channel group
123      * @throws LcnException when the command could not processed
124      */
125     void handleCommandString(StringType command, int number) throws LcnException;
126
127     /**
128      * Handles a Command from openHAB.
129      *
130      * @param command the command to handle
131      * @param channelGroup the addressed Channel group
132      * @param number the Channel's number within the Channel group
133      * @param invertUpDown true, if Up/Down is inverted
134      * @throws LcnException when the command could not processed
135      */
136     void handleCommandUpDown(UpDownType command, LcnChannelGroup channelGroup, int number, boolean invertUpDown)
137             throws LcnException;
138
139     /**
140      * Handles a Command from openHAB.
141      *
142      * @param command the command to handle
143      * @param channelGroup the addressed Channel group
144      * @param number the Channel's number within the Channel group
145      * @throws LcnException when the command could not processed
146      */
147     void handleCommandStopMove(StopMoveType command, LcnChannelGroup channelGroup, int number) throws LcnException;
148
149     /**
150      * Handles a Command from openHAB.
151      *
152      * @param command the command to handle
153      * @param groupId the Channel's name within the Channel group
154      * @throws LcnException when the command could not processed
155      */
156     void handleCommandHsb(HSBType command, String groupId) throws LcnException;
157 }