]> git.basschouten.com Git - openhab-addons.git/blob
839e5d7c6ba92cd17f31d4ca526decf3a12d6c85
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 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.airgradient.internal;
14
15 import java.time.Duration;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.core.thing.ThingTypeUID;
19
20 /**
21  * The {@link AirGradientBindingConstants} class defines common constants, which are
22  * used across the whole binding.
23  *
24  * @author Jørgen Austvik - Initial contribution
25  */
26 @NonNullByDefault
27 public class AirGradientBindingConstants {
28
29     private static final String BINDING_ID = "airgradient";
30
31     // List of all Thing Type UIDs
32     public static final ThingTypeUID THING_TYPE_API = new ThingTypeUID(BINDING_ID, "airgradient-api");
33     public static final ThingTypeUID THING_TYPE_LOCAL = new ThingTypeUID(BINDING_ID, "airgradient-local");
34     public static final ThingTypeUID THING_TYPE_LOCATION = new ThingTypeUID(BINDING_ID, "location");
35
36     // List of all Channel ids
37     public static final String CHANNEL_PM_01 = "pm01";
38     public static final String CHANNEL_PM_02 = "pm02";
39     public static final String CHANNEL_PM_10 = "pm10";
40     public static final String CHANNEL_PM_003_COUNT = "pm003-count";
41     public static final String CHANNEL_ATMP = "atmp";
42     public static final String CHANNEL_RHUM = "rhum";
43     public static final String CHANNEL_WIFI = "wifi";
44     public static final String CHANNEL_RCO2 = "rco2";
45     public static final String CHANNEL_TVOC = "tvoc";
46     public static final String CHANNEL_LEDS_MODE = "leds";
47     public static final String CHANNEL_CALIBRATION = "calibration";
48     public static final String CHANNEL_UPLOADS_SINCE_BOOT = "uploads-since-boot";
49
50     // List of all properties
51     public static final String PROPERTY_NAME = "name";
52
53     // All configurations
54     public static final String CONFIG_LOCATION = "location";
55     public static final String CONFIG_API_TOKEN = "token";
56     public static final String CONFIG_API_HOST_NAME = "hostname";
57     public static final String CONFIG_API_REFRESH_INTERVAL = "refreshInterval";
58
59     // URLs for API
60     public static final String CURRENT_MEASURES_PATH = "/public/api/v1/locations/measures/current?token=%s";
61     public static final String CURRENT_MEASURES_LOCAL_PATH = "/measures/current";
62     public static final String LEDS_MODE_PATH = "/public/api/v1/sensors/%s/config/leds/mode?token=%s";
63     public static final String CALIBRATE_CO2_PATH = "/public/api/v1/sensors/%s/co2/calibration?token=%s";
64
65     // Discovery
66     public static final Duration SEARCH_TIME = Duration.ofSeconds(15);
67     public static final boolean BACKGROUND_DISCOVERY = true;
68     public static final Duration DEFAULT_POLL_INTERVAL_LOCAL = Duration.ofSeconds(10);
69
70     // Media types
71     public static final String CONTENTTYPE_JSON = "application/json";
72     public static final String CONTENTTYPE_TEXT = "text/plain";
73     public static final String CONTENTTYPE_OPENMETRICS = "application/openmetrics-text";
74
75     // Communication
76     public static final Duration REQUEST_TIMEOUT = Duration.ofSeconds(10);
77 }