]> git.basschouten.com Git - openhab-addons.git/blob
2ad91110339376ef439ca2f41094298134bad518
[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.konnected.internal;
14
15 import java.util.Map;
16 import java.util.stream.Collectors;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.openhab.core.thing.ThingTypeUID;
20
21 /**
22  * The {@link KonnectedBindingConstants} class defines common constants, which are
23  * used across the whole binding.
24  *
25  * @author Zachary Christiansen - Initial contribution
26  */
27 @NonNullByDefault
28 public class KonnectedBindingConstants {
29
30     public static final String BINDING_ID = "konnected";
31     public static final String PRO_MODULE = "pro-module";
32     public static final String WIFI_MODULE = "wifi-module";
33
34     // List of all Thing Type UIDs
35     public static final ThingTypeUID THING_TYPE_WIFIMODULE = new ThingTypeUID(BINDING_ID, WIFI_MODULE);
36     public static final ThingTypeUID THING_TYPE_PROMODULE = new ThingTypeUID(BINDING_ID, PRO_MODULE);
37
38     // Thing config properties
39     public static final String BASE_URL = "baseUrl";
40     public static final String MAC_ADDR = "macAddress";
41     public static final String REQUEST_TIMEOUT = "requestTimeout";
42     public static final String RETRY_COUNT = "retryCount";
43     public static final String CALLBACK_URL = "callbackUrl";
44
45     // ESP8266_ZONE_TO_PIN map, this maps a zone to a pin for ESP8266 based devices
46     // Source: https://help.konnected.io/support/solutions/articles/32000026808-zone-to-gpio-pin-mapping
47     public static final Map<String, Integer> ESP8266_ZONE_TO_PIN = Map.of("1", 1, "2", 2, "3", 5, "4", 6, "5", 7, "6",
48             9, "alarm_out", 8);
49     public static final Map<Integer, String> ESP8266_PIN_TO_ZONE = ESP8266_ZONE_TO_PIN.entrySet().stream()
50             .collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey));
51
52     // channeltypeids
53     public static final String CHANNEL_SWITCH = "konnected:switch";
54     public static final String CHANNEL_ACTUATOR = "konnected:actuator";
55     public static final String CHANNEL_TEMPERATURE = "konnected:temperature";
56     public static final String CHANNEL_HUMIDITY = "konnected:humidity";
57 }