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.lcn.internal.subhandler;
15 import java.util.Collection;
16 import java.util.regex.Matcher;
17 import java.util.regex.Pattern;
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;
32 * Interface for LCN module Thing sub handlers processing variables.
34 * @author Fabian Wolter - Initial contribution
37 public interface ILcnModuleSubHandler {
39 * Gets the Patterns, the sub handler is capable to process.
41 * @return the Patterns
43 Collection<Pattern> getPckStatusMessagePatterns();
46 * Processes the payload of a pre-matched PCK message.
48 * @param matcher the pre-matched matcher.
49 * @throws LcnException when the message cannot be processed
51 void handleStatusMessage(Matcher matcher) throws LcnException;
54 * Processes a refresh request from openHAB.
56 * @param channelGroup the Channel group that shall be refreshed
57 * @param number the Channel number within the Channel group
59 void handleRefresh(LcnChannelGroup channelGroup, int number);
62 * Processes a refresh request from openHAB.
64 * @param groupId the Channel ID that shall be refreshed
66 void handleRefresh(String groupId);
69 * Handles a Command from openHAB.
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
76 void handleCommandOnOff(OnOffType command, LcnChannelGroup channelGroup, int number) throws LcnException;
79 * Handles a Command from openHAB.
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
86 void handleCommandPercent(PercentType command, LcnChannelGroup channelGroup, int number) throws LcnException;
89 * Handles a Command from openHAB.
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
96 void handleCommandPercent(PercentType command, LcnChannelGroup channelGroup, String idWithoutGroup)
100 * Handles a Command from openHAB.
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
107 void handleCommandDecimal(DecimalType command, LcnChannelGroup channelGroup, int number) throws LcnException;
110 * Handles a Command from openHAB.
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
116 void handleCommandDimmerOutput(DimmerOutputCommand command, int number) throws LcnException;
119 * Handles a Command from openHAB.
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
125 void handleCommandString(StringType command, int number) throws LcnException;
128 * Handles a Command from openHAB.
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
136 void handleCommandUpDown(UpDownType command, LcnChannelGroup channelGroup, int number, boolean invertUpDown)
140 * Handles a Command from openHAB.
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
147 void handleCommandStopMove(StopMoveType command, LcnChannelGroup channelGroup, int number) throws LcnException;
150 * Handles a Command from openHAB.
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
156 void handleCommandHsb(HSBType command, String groupId) throws LcnException;