]> git.basschouten.com Git - openhab-addons.git/blob
b939bd4da1381981c52b1dba3ac87d3b729c0aee
[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.pixometer.internal;
14
15 import java.util.Collections;
16 import java.util.Set;
17 import java.util.stream.Collectors;
18 import java.util.stream.Stream;
19
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.openhab.core.thing.ThingTypeUID;
22
23 /**
24  * The {@link PixometerBindingConstants} class defines common constants, which are
25  * used across the whole binding.
26  *
27  * @author Jerome Luckenbach - Initial contribution
28  */
29 @NonNullByDefault
30 public class PixometerBindingConstants {
31
32     private static final String BINDING_ID = "pixometer";
33
34     // Api base url
35     public static final String API_BASE_URL = "https://pixometer.io/api/";
36
37     // List of all Thing Type UIDs
38     public static final ThingTypeUID BRIDGE_THING_TYPE = new ThingTypeUID(BINDING_ID, "account");
39     public static final ThingTypeUID THING_TYPE_ENERGYMETER = new ThingTypeUID(BINDING_ID, "energymeter");
40     public static final ThingTypeUID THING_TYPE_GASMETER = new ThingTypeUID(BINDING_ID, "gasmeter");
41     public static final ThingTypeUID THING_TYPE_WATERMETER = new ThingTypeUID(BINDING_ID, "watermeter");
42
43     public static final Set<ThingTypeUID> BRIDGE_THING_TYPES_UIDS = Collections.singleton(BRIDGE_THING_TYPE);
44     public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Stream
45             .of(THING_TYPE_ENERGYMETER, THING_TYPE_GASMETER, THING_TYPE_WATERMETER).collect(Collectors.toSet());
46
47     // List of all Channel ids
48     public static final String CHANNEL_LAST_READING_VALUE = "last_reading_value";
49     public static final String CHANNEL_LAST_READING_DATE = "last_reading_date";
50     public static final String CHANNEL_LAST_REFRESH_DATE = "last_refresh_date";
51
52     // List of all config ids
53     public static final String CONFIG_BRIDGE_PASSWORD = "password";
54     public static final String CONFIG_BRIDGE_REFRESH = "refresh";
55     public static final String CONFIG_BRIDGE_USER = "user";
56
57     public static final String CONFIG_THING_RESSOURCE_ID = "resource_id";
58
59     // References for needed API identifiers
60     public static final String AUTH_TOKEN = "access_token";
61 }