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.hdanywhere.internal;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.thing.ThingTypeUID;
19 * The {@link HDanywhereBinding} class defines common constants, which are used
20 * across the whole binding.
22 * @author Karel Goderis - Initial contribution
25 public class HDanywhereBindingConstants {
27 public static final String BINDING_ID = "hdanywhere";
29 // List of all Thing Type UIDs
30 public static final ThingTypeUID THING_TYPE_MULTIROOMPLUS = new ThingTypeUID(BINDING_ID, "multiroomplus");
31 public static final ThingTypeUID THING_TYPE_MHUB4K431 = new ThingTypeUID(BINDING_ID, "mhub4k431");
33 // List of all Channel ids
44 private final int number;
45 private final String id;
47 private Port(final int number, final String id) {
53 public String toString() {
54 return String.valueOf(number);
57 public int toNumber() {
61 public static Port get(int valueSelectorNumber) throws IllegalArgumentException {
62 for (Port c : Port.values()) {
63 if (c.number == valueSelectorNumber) {
68 throw new IllegalArgumentException("Not valid value selector");
71 public static Port get(String valueSelectorText) throws IllegalArgumentException {
72 for (Port c : Port.values()) {
73 if (c.id.equals(valueSelectorText)) {
78 throw new IllegalArgumentException("Not valid value selector");
81 public String channelID() {