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.zoneminder.internal;
15 import java.util.Collections;
17 import java.util.stream.Collectors;
18 import java.util.stream.Stream;
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.openhab.core.thing.ThingTypeUID;
24 * The {@link ZmBindingConstants} class defines common constants that are
25 * used across the whole binding.
27 * @author Mark Hilbush - Initial contribution
30 public class ZmBindingConstants {
32 private static final String BINDING_ID = "zoneminder";
35 public static final String THING_TYPE_SERVER = "server";
36 public static final ThingTypeUID UID_SERVER = new ThingTypeUID(BINDING_ID, THING_TYPE_SERVER);
37 public static final Set<ThingTypeUID> SUPPORTED_SERVER_THING_TYPES_UIDS = Collections
38 .unmodifiableSet(Stream.of(UID_SERVER).collect(Collectors.toSet()));
41 public static final String THING_TYPE_MONITOR = "monitor";
42 public static final ThingTypeUID UID_MONITOR = new ThingTypeUID(BINDING_ID, THING_TYPE_MONITOR);
44 // Collection of monitor thing types
45 public static final Set<ThingTypeUID> SUPPORTED_MONITOR_THING_TYPES_UIDS = Collections
46 .unmodifiableSet(Stream.of(UID_MONITOR).collect(Collectors.toSet()));
48 // Collection of all supported thing types
49 public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.unmodifiableSet(
50 Stream.concat(SUPPORTED_MONITOR_THING_TYPES_UIDS.stream(), SUPPORTED_SERVER_THING_TYPES_UIDS.stream())
51 .collect(Collectors.toSet()));
55 public static final String CONFIG_HOST = "host";
56 public static final String CONFIG_PORT_NUMBER = "portNumber";
57 public static final String CONFIG_URL_PATH = "urlPath";
58 public static final String CONFIG_DEFAULT_ALARM_DURATION = "defaultAlarmDuration";
59 public static final String CONFIG_DEFAULT_IMAGE_REFRESH_INTERVAL = "defaultImageRefreshInterval";
62 public static final String CONFIG_MONITOR_ID = "monitorId";
63 public static final String CONFIG_IMAGE_REFRESH_INTERVAL = "imageRefreshInterval";
64 public static final String CONFIG_ALARM_DURATION = "alarmDuration";
66 public static final int DEFAULT_ALARM_DURATION_SECONDS = 60;
67 public static final String DEFAULT_URL_PATH = "/zm";
69 // List of all channel ids
70 public static final String CHANNEL_IMAGE_MONITOR_ID = "imageMonitorId";
71 public static final String CHANNEL_VIDEO_MONITOR_ID = "videoMonitorId";
72 public static final String CHANNEL_ID = "id";
73 public static final String CHANNEL_NAME = "name";
74 public static final String CHANNEL_IMAGE = "image";
75 public static final String CHANNEL_FUNCTION = "function";
76 public static final String CHANNEL_ENABLE = "enable";
77 public static final String CHANNEL_ALARM = "alarm";
78 public static final String CHANNEL_STATE = "state";
79 public static final String CHANNEL_TRIGGER_ALARM = "triggerAlarm";
80 public static final String CHANNEL_HOUR_EVENTS = "hourEvents";
81 public static final String CHANNEL_DAY_EVENTS = "dayEvents";
82 public static final String CHANNEL_WEEK_EVENTS = "weekEvents";
83 public static final String CHANNEL_MONTH_EVENTS = "monthEvents";
84 public static final String CHANNEL_TOTAL_EVENTS = "totalEvents";
85 public static final String CHANNEL_IMAGE_URL = "imageUrl";
86 public static final String CHANNEL_VIDEO_URL = "videoUrl";
87 public static final String CHANNEL_EVENT_ID = "eventId";
88 public static final String CHANNEL_EVENT_NAME = "eventName";
89 public static final String CHANNEL_EVENT_CAUSE = "eventCause";
90 public static final String CHANNEL_EVENT_NOTES = "eventNotes";
91 public static final String CHANNEL_EVENT_START = "eventStart";
92 public static final String CHANNEL_EVENT_END = "eventEnd";
93 public static final String CHANNEL_EVENT_FRAMES = "eventFrames";
94 public static final String CHANNEL_EVENT_ALARM_FRAMES = "eventAlarmFrames";
95 public static final String CHANNEL_EVENT_LENGTH = "eventLength";