]> git.basschouten.com Git - openhab-addons.git/blob
1282f2c630a0e6ff133df74d6f88e8f2c9144275
[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.mcd.internal.util;
14
15 import java.util.ArrayList;
16 import java.util.Arrays;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19
20 /**
21  * class that contains MCD SensorEventDefinitions
22  * 
23  * @author Simon Dengler - Initial contribution
24  */
25 @NonNullByDefault
26 public class SensorEventDef {
27
28     // Sensor Events in order of their ids as specified by C&S syncapi
29     private static final String[] EVENT_DEFINITION_ARRAY = { "", "UNDEFINED", "BEDEXIT", "BEDENTRY", "FALL",
30             "CHANGEPOSITION", "BATTERYSTATE", "INACTIVITY", "ALARM", "OPEN", "CLOSE", "ON", "OFF", "ACTIVITY",
31             "CAPACITY", "GAS", "VITALVALUE", "ROOMEXIT", "ROOMENTRY", "REMOVESENSOR", "SITDOWN", "STANDUP",
32             "INACTIVITYROOM", "SMOKEALARM", "HEAT", "COLD", "QUALITYAIR", "ALARMAIR", "ROOMTEMPERATURE", "HUMIDITY",
33             "AIRPRESSURE", "CO2", "INDEXUV", "WEARTIME", "FIRSTURINE", "NEWDIAPER", "DIAPERREMOVED", "NOCONNECTION",
34             "LOWBATTERY", "CONTROLLSENSOR", "LYING", "SPILLED", "DAMAGED", "GEOEXIT", "GEOENTRY", "WALKING", "RESTING",
35             "TURNAROUND", "HOMEEMERGENCY", "TOILETFLUSH", "DORSALPOSITION", "ABDOMINALPOSITION", "LYINGLEFT",
36             "LYINGRIGHT", "LYINGHALFLEFT", "LYINGHALFRIGHT", "MOVEMENT", "PRESENCE", "NUMBERPERSONS",
37             "BRIGHTNESSZONE" };
38     private static ArrayList<String> sensorEventDefinition = new ArrayList<String>(
39             Arrays.asList(EVENT_DEFINITION_ARRAY));
40
41     public static ArrayList<String> getSensorEventDefinition() {
42         return sensorEventDefinition;
43     }
44
45     public static int getSensorEventId(String eventName) {
46         return sensorEventDefinition.indexOf(eventName);
47     }
48 }