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.networkupstools.internal;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.core.thing.ThingTypeUID;
19 import org.openhab.core.thing.type.ChannelTypeUID;
22 * The {@link NUTBindingConstants} class defines common constants, which are
23 * used across the whole binding.
25 * @author Hilbrand Bouwkamp - Initial contribution
28 public class NUTBindingConstants {
30 public static final String BINDING_ID = "networkupstools";
32 // List of all Thing Type UIDs
33 public static final ThingTypeUID THING_TYPE_UPS = new ThingTypeUID(BINDING_ID, "ups");
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");
42 private static final String PARAMETER_PREFIX_UPS = "ups.";
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).
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");
57 private final String nutName;
59 Parameters(final String nutName) {
60 this.nutName = nutName;
63 public String getNutName() {