]> git.basschouten.com Git - openhab-addons.git/blob
9a34868badc74e063032d6c53ef4c32422ad3ba3
[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.dsmr.internal.meter;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * This class describes the kind of meters the binding supports
19  *
20  * @author M. Volaart - Initial contribution
21  */
22 @NonNullByDefault
23 public enum DSMRMeterKind {
24     INVALID,
25     DEVICE(false),
26     MAIN_ELECTRICITY,
27     GAS,
28     HEATING,
29     COOLING,
30     WATER,
31     GENERIC,
32     GJ,
33     M3,
34     SLAVE_ELECTRICITY1,
35     SLAVE_ELECTRICITY2;
36
37     private final boolean channelRelevant;
38
39     private DSMRMeterKind() {
40         this(true);
41     }
42
43     private DSMRMeterKind(final boolean channelRelevant) {
44         this.channelRelevant = channelRelevant;
45     }
46
47     public boolean isChannelRelevant() {
48         return channelRelevant;
49     }
50
51     /**
52      * @return Returns the i18n label key for this meter.
53      */
54     public String getLabelKey() {
55         return "@text/meterKind." + name().toLowerCase() + ".label";
56     }
57 }