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;
16 import java.util.stream.Collectors;
17 import java.util.stream.Stream;
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.openhab.core.thing.ThingTypeUID;
23 * The {@link PixometerBindingConstants} class defines common constants, which are
24 * used across the whole binding.
26 * @author Jerome Luckenbach - Initial contribution
29 public class PixometerBindingConstants {
31 private static final String BINDING_ID = "pixometer";
34 public static final String API_BASE_URL = "https://pixometer.io/api/";
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");
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());
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";
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";
56 public static final String CONFIG_THING_RESSOURCE_ID = "resource_id";
58 // References for needed API identifiers
59 public static final String AUTH_TOKEN = "access_token";