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.chromecast.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 ChromecastBindingConstants} class defines common constants, which are
25 * used across the whole binding.
27 * @author Kai Kreuzer - Initial contribution
28 * @author Jason Holmes - Additional channels
31 public class ChromecastBindingConstants {
32 public static final String BINDING_ID = "chromecast";
33 public static final String MEDIA_PLAYER = "CC1AD845";
35 public static final ThingTypeUID THING_TYPE_CHROMECAST = new ThingTypeUID(BINDING_ID, "chromecast");
36 public static final ThingTypeUID THING_TYPE_AUDIO = new ThingTypeUID(BINDING_ID, "audio");
37 public static final ThingTypeUID THING_TYPE_AUDIOGROUP = new ThingTypeUID(BINDING_ID, "audiogroup");
39 public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.unmodifiableSet(
40 Stream.of(THING_TYPE_AUDIO, THING_TYPE_AUDIOGROUP, THING_TYPE_CHROMECAST).collect(Collectors.toSet()));
43 public static final String HOST = "ipAddress";
44 public static final String PORT = "port";
45 public static final String DEVICE_ID = "deviceId";
48 public static final String CHANNEL_CONTROL = "control";
49 public static final String CHANNEL_STOP = "stop";
50 public static final String CHANNEL_VOLUME = "volume";
51 public static final String CHANNEL_MUTE = "mute";
52 public static final String CHANNEL_PLAY_URI = "playuri";
54 public static final String CHANNEL_APP_NAME = "appName";
55 public static final String CHANNEL_APP_ID = "appId";
56 public static final String CHANNEL_IDLING = "idling";
57 public static final String CHANNEL_STATUS_TEXT = "statustext";
59 public static final String CHANNEL_CURRENT_TIME = "currentTime";
60 public static final String CHANNEL_DURATION = "duration";
62 public static final String CHANNEL_METADATA_TYPE = "metadataType";
64 public static final String CHANNEL_ALBUM_ARTIST = "albumArtist";
65 public static final String CHANNEL_ALBUM_NAME = "albumName";
66 public static final String CHANNEL_ARTIST = "artist";
67 public static final String CHANNEL_BROADCAST_DATE = "broadcastDate";
68 public static final String CHANNEL_COMPOSER = "composer";
69 public static final String CHANNEL_CREATION_DATE = "creationDate";
70 public static final String CHANNEL_DISC_NUMBER = "discNumber";
71 public static final String CHANNEL_EPISODE_NUMBER = "episodeNumber";
72 public static final String CHANNEL_IMAGE = "image";
73 public static final String CHANNEL_IMAGE_SRC = "imageSrc";
74 public static final String CHANNEL_LOCATION_NAME = "locationName";
75 public static final String CHANNEL_LOCATION = "location";
76 public static final String CHANNEL_RELEASE_DATE = "releaseDate";
77 public static final String CHANNEL_SEASON_NUMBER = "seasonNumber";
78 public static final String CHANNEL_SERIES_TITLE = "seriesTitle";
79 public static final String CHANNEL_STUDIO = "studio";
80 public static final String CHANNEL_SUBTITLE = "subtitle";
81 public static final String CHANNEL_TITLE = "title";
82 public static final String CHANNEL_TRACK_NUMBER = "trackNumber";
85 * These are channels that map directly. Images and location are unique channels that
86 * don't fit this description.
88 public static final Set<String> METADATA_SIMPLE_CHANNELS = Collections
89 .unmodifiableSet(Stream
90 .of(CHANNEL_ALBUM_ARTIST, CHANNEL_ALBUM_NAME, CHANNEL_ARTIST, CHANNEL_BROADCAST_DATE,
91 CHANNEL_COMPOSER, CHANNEL_CREATION_DATE, CHANNEL_DISC_NUMBER, CHANNEL_EPISODE_NUMBER,
92 CHANNEL_LOCATION_NAME, CHANNEL_RELEASE_DATE, CHANNEL_SEASON_NUMBER, CHANNEL_SERIES_TITLE,
93 CHANNEL_STUDIO, CHANNEL_SUBTITLE, CHANNEL_TITLE, CHANNEL_TRACK_NUMBER)
94 .collect(Collectors.toSet()));
96 // We don't key these metadata keys directly to a channel, they get linked together
97 // into a Location channel.
98 public static final String LOCATION_METADATA_LATITUDE = "locationLatitude";
99 public static final String LOCATION_METADATA_LONGITUDE = "locationLongitude";