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.konnected.internal;
16 import java.util.stream.Collectors;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.openhab.core.thing.ThingTypeUID;
22 * The {@link KonnectedBindingConstants} class defines common constants, which are
23 * used across the whole binding.
25 * @author Zachary Christiansen - Initial contribution
28 public class KonnectedBindingConstants {
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";
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);
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";
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",
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));
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";