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.jablotron;
15 import java.util.Arrays;
16 import java.util.HashSet;
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.openhab.core.thing.ThingTypeUID;
23 * The {@link JablotronBindingConstants} class defines common constants, which are
24 * used across the whole binding.
26 * @author Ondrej Pecta - Initial contribution
29 public class JablotronBindingConstants {
31 public static final String BINDING_ID = "jablotron";
33 // List of all Thing Type UIDs
34 public static final ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, "bridge");
35 public static final ThingTypeUID THING_TYPE_OASIS = new ThingTypeUID(BINDING_ID, "oasis");
36 public static final ThingTypeUID THING_TYPE_JA100 = new ThingTypeUID(BINDING_ID, "ja100");
37 public static final ThingTypeUID THING_TYPE_JA100F = new ThingTypeUID(BINDING_ID, "ja100f");
39 // Common alarm channels
40 public static final String CHANNEL_ALARM = "alarm";
41 public static final String CHANNEL_LAST_CHECK_TIME = "lastCheckTime";
42 public static final String CHANNEL_LAST_EVENT = "lastEvent";
43 public static final String CHANNEL_LAST_EVENT_CLASS = "lastEventClass";
44 public static final String CHANNEL_LAST_EVENT_TIME = "lastEventTime";
45 public static final String CHANNEL_LAST_EVENT_INVOKER = "lastEventInvoker";
46 public static final String CHANNEL_LAST_EVENT_SECTION = "lastEventSection";
48 // List of all OASIS Channel ids
49 public static final String CHANNEL_COMMAND = "command";
50 public static final String CHANNEL_STATUS_A = "statusA";
51 public static final String CHANNEL_STATUS_B = "statusB";
52 public static final String CHANNEL_STATUS_ABC = "statusABC";
53 public static final String CHANNEL_STATUS_PGX = "statusPGX";
54 public static final String CHANNEL_STATUS_PGY = "statusPGY";
57 public static final String JABLOTRON_API_URL = "https://api.jablonet.net/api/1.6/";
58 public static final String AGENT = "Swagger-Codegen/1.0.0/android";
59 public static final int TIMEOUT_SEC = 10;
60 public static final String SYSTEM = "openHAB";
61 public static final String VENDOR = "JABLOTRON:Jablotron";
62 public static final String APPLICATION_JSON = "application/json";
63 public static final String WWW_FORM_URLENCODED = "application/x-www-form-urlencoded; charset=UTF-8";
64 public static final String AUTHENTICATION_CHALLENGE = "Authentication challenge without WWW-Authenticate header";
65 public static final String PROPERTY_SERVICE_ID = "serviceId";
66 public static final int DISCOVERY_TIMEOUT_SEC = 10;
67 public static final int CACHE_TIMEOUT_MS = 10000;
69 // supported thing types for discovery
70 public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = new HashSet<>(
71 Arrays.asList(THING_TYPE_OASIS, THING_TYPE_JA100, THING_TYPE_JA100F));