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.plex.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 PlexBindingConstants} class defines common constants, which are
25 * used across the whole binding.
27 * @author Brian Homeyer - Initial contribution
28 * @author Aron Beurskens - Binding development
31 public class PlexBindingConstants {
32 private static final String BINDING_ID = "plex";
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);
40 public static final String THING_TYPE_PLAYER = "player";
41 public static final ThingTypeUID UID_PLAYER = new ThingTypeUID(BINDING_ID, THING_TYPE_PLAYER);
43 // Collection of monitor thing types
44 public static final Set<ThingTypeUID> SUPPORTED_PLAYER_THING_TYPES_UIDS = Set.of(UID_PLAYER);
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;
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";
59 public static final String CONFIG_PLAYER_ID = "playerID";
60 public static final String CONFIG_PLAYER_NAME = "playerName";
62 // List of all Channel ids
64 public static final String CHANNEL_SERVER_COUNT = "currentPlayers";
65 public static final String CHANNEL_SERVER_COUNTACTIVE = "currentPlayersActive";
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";