]> git.basschouten.com Git - openhab-addons.git/blob
1d78f7c5b782e31d3aae3644f74343fa7591e4b4
[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.zoneminder.internal;
14
15 import java.util.Collections;
16 import java.util.Set;
17 import java.util.stream.Collectors;
18 import java.util.stream.Stream;
19
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.openhab.core.thing.ThingTypeUID;
22
23 /**
24  * The {@link ZmBindingConstants} class defines common constants that are
25  * used across the whole binding.
26  *
27  * @author Mark Hilbush - Initial contribution
28  */
29 @NonNullByDefault
30 public class ZmBindingConstants {
31
32     private static final String BINDING_ID = "zoneminder";
33
34     // Bridge thing
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()));
39
40     // Monitor things
41     public static final String THING_TYPE_MONITOR = "monitor";
42     public static final ThingTypeUID UID_MONITOR = new ThingTypeUID(BINDING_ID, THING_TYPE_MONITOR);
43
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()));
47
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()));
52
53     // Config parameters
54     // Server
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";
60
61     // Monitor
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";
65
66     public static final int DEFAULT_ALARM_DURATION_SECONDS = 60;
67     public static final String DEFAULT_URL_PATH = "/zm";
68
69     // List of all channel ids
70     public static final String CHANNEL_RUN_STATE = "runState";
71     public static final String CHANNEL_IMAGE_MONITOR_ID = "imageMonitorId";
72     public static final String CHANNEL_VIDEO_MONITOR_ID = "videoMonitorId";
73     public static final String CHANNEL_ID = "id";
74     public static final String CHANNEL_NAME = "name";
75     public static final String CHANNEL_IMAGE = "image";
76     public static final String CHANNEL_FUNCTION = "function";
77     public static final String CHANNEL_ENABLE = "enable";
78     public static final String CHANNEL_ALARM = "alarm";
79     public static final String CHANNEL_STATE = "state";
80     public static final String CHANNEL_TRIGGER_ALARM = "triggerAlarm";
81     public static final String CHANNEL_HOUR_EVENTS = "hourEvents";
82     public static final String CHANNEL_DAY_EVENTS = "dayEvents";
83     public static final String CHANNEL_WEEK_EVENTS = "weekEvents";
84     public static final String CHANNEL_MONTH_EVENTS = "monthEvents";
85     public static final String CHANNEL_TOTAL_EVENTS = "totalEvents";
86     public static final String CHANNEL_IMAGE_URL = "imageUrl";
87     public static final String CHANNEL_VIDEO_URL = "videoUrl";
88     public static final String CHANNEL_EVENT_ID = "eventId";
89     public static final String CHANNEL_EVENT_NAME = "eventName";
90     public static final String CHANNEL_EVENT_CAUSE = "eventCause";
91     public static final String CHANNEL_EVENT_NOTES = "eventNotes";
92     public static final String CHANNEL_EVENT_START = "eventStart";
93     public static final String CHANNEL_EVENT_END = "eventEnd";
94     public static final String CHANNEL_EVENT_FRAMES = "eventFrames";
95     public static final String CHANNEL_EVENT_ALARM_FRAMES = "eventAlarmFrames";
96     public static final String CHANNEL_EVENT_LENGTH = "eventLength";
97 }