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