]> git.basschouten.com Git - openhab-addons.git/blob
5d744e9e4d094775d237d5a6bfd3e6052d4b26a2
[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.nuvo.internal.communication;
14
15 import java.util.Arrays;
16 import java.util.List;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19
20 /**
21  * Represents the different internal zone and source IDs of the Nuvo Whole House Amplifier
22  *
23  * @author Michael Lobstein - Initial contribution
24  */
25 @NonNullByDefault
26 public enum NuvoEnum {
27     SYSTEM("SYSTEM", "SYSTEM", 0),
28     ZONE1("Z1", "ZCFG1", 1),
29     ZONE2("Z2", "ZCFG2", 2),
30     ZONE3("Z3", "ZCFG3", 3),
31     ZONE4("Z4", "ZCFG4", 4),
32     ZONE5("Z5", "ZCFG5", 5),
33     ZONE6("Z6", "ZCFG6", 6),
34     ZONE7("Z7", "ZCFG7", 7),
35     ZONE8("Z8", "ZCFG8", 8),
36     ZONE9("Z9", "ZCFG9", 9),
37     ZONE10("Z10", "ZCFG10", 10),
38     ZONE11("Z11", "ZCFG11", 11),
39     ZONE12("Z12", "ZCFG12", 12),
40     ZONE13("Z13", "ZCFG13", 13),
41     ZONE14("Z14", "ZCFG14", 14),
42     ZONE15("Z15", "ZCFG15", 15),
43     ZONE16("Z16", "ZCFG16", 16),
44     ZONE17("Z17", "ZCFG17", 17),
45     ZONE18("Z18", "ZCFG18", 18),
46     ZONE19("Z19", "ZCFG19", 19),
47     ZONE20("Z20", "ZCFG20", 20),
48     SOURCE1("S1", "SCFG1", 1),
49     SOURCE2("S2", "SCFG2", 2),
50     SOURCE3("S3", "SCFG3", 3),
51     SOURCE4("S4", "SCFG4", 4),
52     SOURCE5("S5", "SCFG5", 5),
53     SOURCE6("S6", "SCFG6", 6);
54
55     private final String id;
56     private final String cfgId;
57     private final int num;
58
59     // make a list of all valid source enums
60     public static final List<NuvoEnum> VALID_SOURCES = Arrays.stream(values()).filter(s -> s.name().contains("SOURCE"))
61             .toList();
62
63     NuvoEnum(String id, String cfgId, int num) {
64         this.id = id;
65         this.cfgId = cfgId;
66         this.num = num;
67     }
68
69     /**
70      * Get the id
71      *
72      * @return the id
73      */
74     public String getId() {
75         return id;
76     }
77
78     /**
79      * Get the config id
80      *
81      * @return the config id
82      */
83     public String getConfigId() {
84         return cfgId;
85     }
86
87     /**
88      * Get the num
89      *
90      * @return the num
91      */
92     public int getNum() {
93         return num;
94     }
95 }