2 * Copyright (c) 2010-2024 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.flicbutton.internal;
15 import java.util.Collections;
16 import java.util.HashMap;
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.openhab.core.thing.CommonTriggerEvents;
22 import org.openhab.core.thing.ThingTypeUID;
25 * The {@link FlicButtonBindingConstants} class defines common constants, which are
26 * used across the whole binding.
28 * @author Patrick Fink - Initial contribution
31 public class FlicButtonBindingConstants {
33 public static final String BINDING_ID = "flicbutton";
35 // List of all Thing Type UIDs
36 public static final ThingTypeUID BRIDGE_THING_TYPE = new ThingTypeUID(BINDING_ID, "flicd-bridge");
37 public static final ThingTypeUID FLICBUTTON_THING_TYPE = new ThingTypeUID(BINDING_ID, "button");
39 public static final Set<ThingTypeUID> BRIDGE_THING_TYPES_UIDS = Set.of(BRIDGE_THING_TYPE);
40 public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Set.of(FLICBUTTON_THING_TYPE);
42 // List of all configuration options
43 public static final String CONFIG_HOST_NAME = "hostname";
44 public static final String CONFIG_PORT = "port";
45 public static final String CONFIG_ADDRESS = "address";
47 // List of all Channel ids
48 public static final String CHANNEL_ID_RAWBUTTON_EVENTS = "rawbutton";
49 public static final String CHANNEL_ID_BUTTON_EVENTS = "button";
50 public static final String CHANNEL_ID_BATTERY_LEVEL = "battery-level";
53 public static final int BUTTON_OFFLINE_GRACE_PERIOD_SECONDS = 60;
55 public static final Map<String, String> FLIC_OPENHAB_TRIGGER_EVENT_MAP = Collections
56 .unmodifiableMap(new HashMap<String, String>() {
58 put("ButtonSingleClick", CommonTriggerEvents.SHORT_PRESSED);
59 put("ButtonDoubleClick", CommonTriggerEvents.DOUBLE_PRESSED);
60 put("ButtonHold", CommonTriggerEvents.LONG_PRESSED);
61 put("ButtonDown", CommonTriggerEvents.PRESSED);
62 put("ButtonUp", CommonTriggerEvents.RELEASED);