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