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