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.pixometer.internal;
15 import java.util.Collections;
17 import java.util.stream.Collectors;
18 import java.util.stream.Stream;
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.openhab.core.thing.ThingTypeUID;
24 * The {@link PixometerBindingConstants} class defines common constants, which are
25 * used across the whole binding.
27 * @author Jerome Luckenbach - Initial contribution
30 public class PixometerBindingConstants {
32 private static final String BINDING_ID = "pixometer";
35 public static final String API_BASE_URL = "https://pixometer.io/api/";
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");
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());
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";
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";
57 public static final String CONFIG_THING_RESSOURCE_ID = "resource_id";
59 // References for needed API identifiers
60 public static final String AUTH_TOKEN = "access_token";