]> git.basschouten.com Git - openhab-addons.git/blob
baeed8b514a496c59750a400c39c1614b28120d1
[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.digiplex.internal.communication.events;
14
15 import static org.openhab.binding.digiplex.internal.DigiplexBindingConstants.*;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18
19 /**
20  * Trouble event type.
21  *
22  * @author Robert Michalak - Initial contribution
23  *
24  */
25 @NonNullByDefault
26 public enum TroubleType {
27     TLM_TROUBLE(BRIDGE_TLM_TROUBLE),
28     AC_FAILURE(BRIDGE_AC_FAILURE),
29     BATTERY_FAILURE(BRIDGE_BATTERY_FAILURE),
30     AUXILIARY_CURRENT_LIMIT(BRIDGE_AUX_CURRENT_LIMIT),
31     BELL_CURRENT_LIMIT(BRIDGE_BELL_CURRENT_LIMIT),
32     BELL_ABSENT(BRIDGE_BELL_ABSENT),
33     CLOCK_TROUBLE(BRIDGE_CLOCK_TROUBLE),
34     GLOBAL_FIRE_LOOP(BRIDGE_GLOBAL_FIRE_LOOP);
35
36     private String bridgeChannel;
37
38     private TroubleType(String bridgeChannel) {
39         this.bridgeChannel = bridgeChannel;
40     }
41
42     public String getBridgeChannel() {
43         return bridgeChannel;
44     }
45
46     public static TroubleType fromEventNumber(int eventNumber) {
47         return TroubleType.values()[eventNumber];
48     }
49 }