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.wolfsmartset.internal;
15 import java.util.Collections;
16 import java.util.List;
18 import java.util.stream.Collectors;
19 import java.util.stream.Stream;
21 import org.eclipse.jdt.annotation.NonNullByDefault;
22 import org.openhab.binding.wolfsmartset.internal.dto.GetSystemListDTO;
23 import org.openhab.binding.wolfsmartset.internal.dto.SubMenuEntryWithMenuItemTabView;
24 import org.openhab.core.thing.ThingTypeUID;
27 * The {@link WolfSmartsetBindingConstants} class defines common constants that are
28 * used across the whole binding.
30 * @author Bo Biene - Initial contribution
33 public class WolfSmartsetBindingConstants {
35 public static final String BINDING_ID = "wolfsmartset";
38 public static final String THING_TYPE_ACCOUNT = "account";
39 public static final ThingTypeUID UID_ACCOUNT_BRIDGE = new ThingTypeUID(BINDING_ID, THING_TYPE_ACCOUNT);
40 public static final Set<ThingTypeUID> SUPPORTED_ACCOUNT_BRIDGE_THING_TYPES_UIDS = Collections
41 .unmodifiableSet(Stream.of(UID_ACCOUNT_BRIDGE).collect(Collectors.toSet()));
44 public static final String THING_TYPE_SYSTEM = "system";
45 public static final ThingTypeUID UID_SYSTEM_BRIDGE = new ThingTypeUID(BINDING_ID, THING_TYPE_SYSTEM);
46 public static final Set<ThingTypeUID> SUPPORTED_SYSTEM_BRIDGE_THING_TYPES_UIDS = Collections
47 .unmodifiableSet(Stream.of(UID_SYSTEM_BRIDGE).collect(Collectors.toSet()));
50 public static final String THING_TYPE_UNIT = "unit";
51 public static final ThingTypeUID UID_UNIT_THING = new ThingTypeUID(BINDING_ID, THING_TYPE_UNIT);
52 public static final Set<ThingTypeUID> SUPPORTED_UNIT_THING_TYPES_UIDS = Collections
53 .unmodifiableSet(Stream.of(UID_UNIT_THING).collect(Collectors.toSet()));
55 // Collection of system and unit thing types
56 public static final Set<ThingTypeUID> SUPPORTED_SYSTEM_AND_UNIT_THING_TYPES_UIDS = Stream
57 .concat(SUPPORTED_SYSTEM_BRIDGE_THING_TYPES_UIDS.stream(), SUPPORTED_UNIT_THING_TYPES_UIDS.stream())
58 .collect(Collectors.toSet());
60 // Collection of all supported thing types
61 public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.unmodifiableSet(
62 Stream.of(UID_ACCOUNT_BRIDGE, UID_SYSTEM_BRIDGE, UID_UNIT_THING).collect(Collectors.toSet()));
65 public static final String THING_PROPERTY_GATEWAY_ID = "GatewayId";
66 public static final String THING_PROPERTY_GATEWAY_USERNAME = "GatewayUsername";
67 public static final String THING_PROPERTY_INSTALLATION_DATE = "InstallationDate";
68 public static final String THING_PROPERTY_LOCATION = "Location";
69 public static final String THING_PROPERTY_OPERATOR_NAME = "OperatorName";
70 public static final String THING_PROPERTY_USERNAME_OWNER = "UserNameOwner";
71 public static final String THING_PROPERTY_ACCESSLEVEL = "AccessLevel";
73 public static final String CH_TEMPERATURE = "temperature";
74 public static final String CH_PRESSURE = "barometric-pressure";
75 public static final String CH_STRING = "string";
76 public static final String CH_CONTACT = "contact";
77 public static final String CH_NUMBER = "number";
78 public static final String CH_DATETIME = "datetime";
80 // Background discovery frequency
81 public static final int DISCOVERY_INTERVAL_SECONDS = 300;
82 public static final int DISCOVERY_INITIAL_DELAY_SECONDS = 10;
84 // System bridge and remote unit thing config parameters
85 public static final String CONFIG_SYSTEM_ID = "systemId";
86 public static final String CONFIG_UNIT_ID = "unitId";
88 public static final List<SubMenuEntryWithMenuItemTabView> EMPTY_UNITS = Collections
89 .<SubMenuEntryWithMenuItemTabView> emptyList();
90 public static final List<GetSystemListDTO> EMPTY_SYSTEMS = Collections.<GetSystemListDTO> emptyList();