]> git.basschouten.com Git - openhab-addons.git/blob
6576cb8be5427d0eae95723ebd88dafbd7a773ff
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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;
14
15 import java.util.regex.Pattern;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.core.thing.ThingTypeUID;
19
20 /**
21  * The {@link LcnBindingConstants} class defines common constants, which are
22  * used across the whole binding.
23  *
24  * @author Fabian Wolter - Initial contribution
25  */
26 @NonNullByDefault
27 public class LcnBindingConstants {
28     /** The scope name of this binding */
29     public static final String BINDING_ID = "lcn";
30     /**
31      * Firmware version of the measurement processing since 2013. It has more variables and thresholds and event-based
32      * variable updates.
33      */
34     public static final int FIRMWARE_2013 = 0x170206;
35     /** Firmware version which supports controlling all 4 outputs simultaneously */
36     public static final int FIRMWARE_2014 = 0x180501;
37     /** List of all Thing Type UIDs */
38     public static final ThingTypeUID THING_TYPE_PCK_GATEWAY = new ThingTypeUID(BINDING_ID, "pckGateway");
39     public static final ThingTypeUID THING_TYPE_MODULE = new ThingTypeUID(BINDING_ID, "module");
40     public static final ThingTypeUID THING_TYPE_GROUP = new ThingTypeUID(BINDING_ID, "group");
41     /** Regex for address in PCK protocol */
42     public static final String ADDRESS_REGEX = "[:=%]M(?<segId>\\d{3})(?<modId>\\d{3})";
43     public static final Pattern MEASUREMENT_PATTERN_BEFORE_2013 = Pattern
44             .compile(LcnBindingConstants.ADDRESS_REGEX + "\\.(?<value>\\d{5})");
45     /** LCN coding for ACK */
46     public static final int CODE_ACK = -1;
47 }