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.digitalstrom.internal.lib.event.constants;
15 import java.util.HashMap;
19 * The {@link EventResponseEnum} contains digitalSTROM-Event properties of the events at {@link EventNames}.
21 * @author Michael Ochel
22 * @author Mathias Siegele
24 public enum EventResponseEnum {
28 PROPERTIES("properties"),
34 IS_APARTMENT("isApartment"),
36 IS_DEVICE("isDevice"),
37 IS_SERVICE("isService"),
41 ORIGEN_TOKEN("originToken"),
42 CALL_ORIGEN("callOrigin"),
43 ORIGEN_DSUID("originDSUID"),
45 ORIGIN_DEVICEID("originDeviceID"),
47 // device/zone sensor value
48 SENSOR_VALUE_FLOAT("sensorValueFloat"),
49 SENSOR_TYPE("sensorType"),
50 SENSOR_VALUE("sensorValue"),
51 SENSOR_INDEX("sensorIndex"),
54 OLD_VALUE("oldvalue"),
55 STATE_NAME("statename"),
61 OPERATION_MODE("operationMode"),
62 FORCED_UPDATE("forceUpdate"),
65 INPUT_TYPE("inputType"),
66 INPUT_STATE("inputState"),
67 INPUT_INDEX("inputIndex");
69 private final String id;
70 static final Map<String, EventResponseEnum> EVENT_RESPONSE_FIELDS = new HashMap<>();
73 for (EventResponseEnum ev : EventResponseEnum.values()) {
74 EVENT_RESPONSE_FIELDS.put(ev.getId(), ev);
79 * Returns true, if the given property exists at the event properties, otherwise false.
81 * @param property to check
82 * @return contains property (true = yes | false = no)
84 public static boolean containsId(String property) {
85 return EVENT_RESPONSE_FIELDS.keySet().contains(property);
89 * Returns the {@link EventResponseEnum} to the given property.
91 * @param property to get
92 * @return EventPropertyEnum
94 public static EventResponseEnum getProperty(String property) {
95 return EVENT_RESPONSE_FIELDS.get(property);
98 private EventResponseEnum(String id) {
103 * Returns the id of this {@link EventResponseEnum}.
105 * @return id of this {@link EventResponseEnum}
107 public String getId() {