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.omnilink.internal;
15 import static org.openhab.binding.omnilink.internal.OmnilinkBindingConstants.*;
17 import java.math.BigInteger;
19 import org.eclipse.jdt.annotation.NonNullByDefault;
22 * The {@link AreaAlarm} class defines the different types of alarms supported
23 * by the OmniLink Protocol.
25 * @author Craig Hamilton - Initial contribution
28 public enum AreaAlarm {
29 BURGLARY(CHANNEL_AREA_ALARM_BURGLARY, 0),
30 FIRE(CHANNEL_AREA_ALARM_FIRE, 1),
31 GAS(CHANNEL_AREA_ALARM_GAS, 2),
32 AUXILIARY(CHANNEL_AREA_ALARM_AUXILIARY, 3),
33 FREEZE(CHANNEL_AREA_ALARM_FREEZE, 4),
34 WATER(CHANNEL_AREA_ALARM_WATER, 5),
35 DURESS(CHANNEL_AREA_ALARM_DURESS, 6),
36 TEMPERATURE(CHANNEL_AREA_ALARM_TEMPERATURE, 7);
38 private final String channelUID;
39 private final int bit;
41 AreaAlarm(String channelUID, int bit) {
42 this.channelUID = channelUID;
46 public boolean isSet(BigInteger alarmBits) {
47 return alarmBits.testBit(bit);
50 public boolean isSet(int alarmBits) {
51 return isSet(BigInteger.valueOf(alarmBits));
54 public String getChannelUID() {