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;
15 import java.util.Collection;
17 import java.util.regex.Pattern;
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.openhab.core.thing.ThingTypeUID;
23 * The {@link LcnBindingConstants} class defines common constants, which are
24 * used across the whole binding.
26 * @author Fabian Wolter - Initial contribution
29 public class LcnBindingConstants {
30 /** The scope name of this binding */
31 public static final String BINDING_ID = "lcn";
33 * Firmware version of the measurement processing since 2013. It has more variables and thresholds and event-based
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",