2 * Copyright (c) 2010-2024 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.mcd.internal.util;
15 import java.util.ArrayList;
16 import java.util.Arrays;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
21 * class that contains MCD SensorEventDefinitions
23 * @author Simon Dengler - Initial contribution
26 public class SensorEventDef {
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",
38 private static ArrayList<String> sensorEventDefinition = new ArrayList<String>(
39 Arrays.asList(EVENT_DEFINITION_ARRAY));
41 public static ArrayList<String> getSensorEventDefinition() {
42 return sensorEventDefinition;
45 public static int getSensorEventId(String eventName) {
46 return sensorEventDefinition.indexOf(eventName);