]> git.basschouten.com Git - openhab-addons.git/blob
95438ac9fd97cd67cf5019532c6c7d45f5f88638
[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.networkupstools.internal;
14
15 import java.net.URI;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.core.thing.ThingTypeUID;
19 import org.openhab.core.thing.type.ChannelTypeUID;
20
21 /**
22  * The {@link NUTBindingConstants} class defines common constants, which are
23  * used across the whole binding.
24  *
25  * @author Hilbrand Bouwkamp - Initial contribution
26  */
27 @NonNullByDefault
28 public class NUTBindingConstants {
29
30     public static final String BINDING_ID = "networkupstools";
31
32     // List of all Thing Type UIDs
33     public static final ThingTypeUID THING_TYPE_UPS = new ThingTypeUID(BINDING_ID, "ups");
34
35     public static final String METADATA_NETWORKUPSTOOLS = "networkupstools";
36     public static final ChannelTypeUID CHANNEL_TYPE_DYNAMIC_NUMBER = new ChannelTypeUID(BINDING_ID, "number");
37     public static final ChannelTypeUID CHANNEL_TYPE_DYNAMIC_STRING = new ChannelTypeUID(BINDING_ID, "string");
38     public static final ChannelTypeUID CHANNEL_TYPE_DYNAMIC_SWITCH = new ChannelTypeUID(BINDING_ID, "switch");
39     public static final URI DYNAMIC_CHANNEL_CONFIG_QUANTITY_TYPE = URI
40             .create("channel-type:ups:dynamic-channel-config-quantity-type");
41
42     private static final String PARAMETER_PREFIX_UPS = "ups.";
43
44     /**
45      * Enum with nut names which value will be set a parameter on the thing.
46      * These are values that don't change at all (e.g. type of ups) or not very often (e.g. firmware version).
47      */
48     public enum Parameters {
49         UPS_FIRMWARE(PARAMETER_PREFIX_UPS + "firmware"),
50         UPS_FIRMWARE_AUX(PARAMETER_PREFIX_UPS + "firmware.aux"),
51         UPS_ID(PARAMETER_PREFIX_UPS + "id"),
52         UPS_MFR(PARAMETER_PREFIX_UPS + "mfr"),
53         UPS_MFR_DATE(PARAMETER_PREFIX_UPS + "mfr.date"),
54         UPS_MODEL(PARAMETER_PREFIX_UPS + "model"),
55         UPS_SERIAL(PARAMETER_PREFIX_UPS + "serial");
56
57         private final String nutName;
58
59         Parameters(final String nutName) {
60             this.nutName = nutName;
61         }
62
63         public String getNutName() {
64             return nutName;
65         }
66     }
67 }