]> git.basschouten.com Git - openhab-addons.git/blob
193c0073825312d2294ea5eb69371eea4292c70c
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 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.plex.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 PlexBindingConstants} class defines common constants, which are
25  * used across the whole binding.
26  *
27  * @author Brian Homeyer - Initial contribution
28  * @author Aron Beurskens - Binding development
29  */
30 @NonNullByDefault
31 public class PlexBindingConstants {
32     private static final String BINDING_ID = "plex";
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 = Set.of(UID_SERVER);
38
39     // Monitor things
40     public static final String THING_TYPE_PLAYER = "player";
41     public static final ThingTypeUID UID_PLAYER = new ThingTypeUID(BINDING_ID, THING_TYPE_PLAYER);
42
43     // Collection of monitor thing types
44     public static final Set<ThingTypeUID> SUPPORTED_PLAYER_THING_TYPES_UIDS = Set.of(UID_PLAYER);
45
46     // Collection of all supported thing types
47     public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.unmodifiableSet(
48             Stream.concat(SUPPORTED_PLAYER_THING_TYPES_UIDS.stream(), SUPPORTED_SERVER_THING_TYPES_UIDS.stream())
49                     .collect(Collectors.toSet()));
50     // General purpose stuff
51     public static final int DEFAULT_REFRESH_PERIOD_SEC = 5;
52     // Config parameters
53     // Server
54     public static final String CONFIG_HOST = "host";
55     public static final String CONFIG_PORT_NUMBER = "portNumber";
56     public static final String CONFIG_TOKEN = "token";
57     public static final String CONFIG_REFRESH_RATE = "refreshRate";
58     // Player parameters
59     public static final String CONFIG_PLAYER_ID = "playerID";
60     public static final String CONFIG_PLAYER_NAME = "playerName";
61
62     // List of all Channel ids
63     // Server
64     public static final String CHANNEL_SERVER_COUNT = "currentPlayers";
65     public static final String CHANNEL_SERVER_COUNTACTIVE = "currentPlayersActive";
66     // Player
67     public static final String CHANNEL_PLAYER_STATE = "state";
68     public static final String CHANNEL_PLAYER_TITLE = "title";
69     public static final String CHANNEL_PLAYER_TYPE = "type";
70     public static final String CHANNEL_PLAYER_POWER = "power";
71     public static final String CHANNEL_PLAYER_ART = "art";
72     public static final String CHANNEL_PLAYER_THUMB = "thumb";
73     public static final String CHANNEL_PLAYER_PROGRESS = "progress";
74     public static final String CHANNEL_PLAYER_ENDTIME = "endtime";
75     public static final String CHANNEL_PLAYER_CONTROL = "player";
76     public static final String CHANNEL_PLAYER_USER = "user";
77 }