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.pioneeravr.internal;
15 import java.util.Collections;
17 import java.util.regex.Pattern;
18 import java.util.stream.Collectors;
19 import java.util.stream.Stream;
21 import org.eclipse.jdt.annotation.NonNullByDefault;
22 import org.openhab.core.thing.ThingTypeUID;
25 * The {@link PioneerAvrBinding} class defines common constants, which are used across the whole binding.
27 * @author Antoine Besnard - Initial contribution
28 * @author Leroy Foerster - Listening Mode, Playing Listening Mode
31 public class PioneerAvrBindingConstants {
33 public static final String BINDING_ID = "pioneeravr";
35 public static final Set<String> SUPPORTED_DEVICE_MODELS = Collections.unmodifiableSet(
36 Stream.of("SC-57", "SC-LX85", "SC-55", "SC-1526", "SC-LX75", "VSX-53", "VSX-1326", "VSX-LX55", "VSX-2021",
37 "VSA-LX55", "VSX-52", "VSX-1126", "VSX-1121", "VSX-51", "VSX-1021", "VSX-1026", "VSA-1021",
38 "VSX-50", "VSX-926", "VSX-921", "VSA-921", "VSX-922").collect(Collectors.toSet()));
40 public static final Set<String> SUPPORTED_DEVICE_MODELS2014 = Collections
41 .unmodifiableSet(Stream.of("SC-LX87", "SC-LX77", "SC-LX57", "SC-2023", "SC-1223", "VSX-1123", "VSX-923")
42 .collect(Collectors.toSet()));
44 public static final Set<String> SUPPORTED_DEVICE_MODELS2015 = Collections.unmodifiableSet(
45 Stream.of("SC-89", "SC-LX88", "SC-87", "SC-LX78", "SC-85", "SC-LX58", "SC-82", "SC-2024", "SC-81", "VSX-80")
46 .collect(Collectors.toSet()));
48 public static final Set<String> SUPPORTED_DEVICE_MODELS2016 = Collections
49 .unmodifiableSet(Stream.of("SC-99", "SC-LX89", "SC-97", "SC-LX79", "SC-95", "SC-LX59", "SC-92", "SC-91",
50 "VSX-90", "VSX-45", "VSX-830", "VSX-930", "VSX-1130").collect(Collectors.toSet()));
52 public static final Set<String> SUPPORTED_DEVICE_MODELS2017 = Collections.unmodifiableSet(
53 Stream.of("VSX-531", "VSX-531D", "VSX-831", "VSX-1131", "VSX-LX101", "VSX-LX301", "VSX-LX501")
54 .collect(Collectors.toSet()));
56 public static final Set<String> SUPPORTED_DEVICE_MODELS2018 = Collections.unmodifiableSet(Stream
57 .of("VSX-532", "VSX-832", "VSX-932", "VSX-LX102", "VSX-LX302", "VSX-LX502").collect(Collectors.toSet()));
59 public static final Set<String> SUPPORTED_DEVICE_MODELS2019 = Collections.unmodifiableSet(
60 Stream.of("VSX-833", "VSX-933", "VSX-LX103", "VSX-LX303", "VSX-LX503").collect(Collectors.toSet()));
62 public static final Set<String> SUPPORTED_DEVICE_MODELS2020 = Collections.unmodifiableSet(Stream
63 .of("VSX-534", "VSX-534D", "VSX-934", "VSX-LX104", "VSX-LX304", "VSX-LX504").collect(Collectors.toSet()));
65 // List of all Thing Type UIDs
66 public static final ThingTypeUID IP_AVR_THING_TYPE = new ThingTypeUID(BINDING_ID, "ipAvr");
67 public static final ThingTypeUID IP_AVR_THING_TYPE2014 = new ThingTypeUID(BINDING_ID, "ipAvr2014");
68 public static final ThingTypeUID IP_AVR_THING_TYPE2015 = new ThingTypeUID(BINDING_ID, "ipAvr2015");
69 public static final ThingTypeUID IP_AVR_THING_TYPE2016 = new ThingTypeUID(BINDING_ID, "ipAvr2016");
70 public static final ThingTypeUID IP_AVR_THING_TYPE2017 = new ThingTypeUID(BINDING_ID, "ipAvr2017");
71 public static final ThingTypeUID IP_AVR_THING_TYPE2018 = new ThingTypeUID(BINDING_ID, "ipAvr2018");
72 public static final ThingTypeUID IP_AVR_THING_TYPE2019 = new ThingTypeUID(BINDING_ID, "ipAvr2019");
73 public static final ThingTypeUID IP_AVR_THING_TYPE2020 = new ThingTypeUID(BINDING_ID, "ipAvr2020");
74 public static final ThingTypeUID IP_AVR_UNSUPPORTED_THING_TYPE = new ThingTypeUID(BINDING_ID, "ipAvrUnsupported");
75 public static final ThingTypeUID SERIAL_AVR_THING_TYPE = new ThingTypeUID(BINDING_ID, "serialAvr");
77 // List of thing parameters names
78 public static final String PROTOCOL_PARAMETER = "protocol";
79 public static final String HOST_PARAMETER = "address";
80 public static final String TCP_PORT_PARAMETER = "tcpPort";
81 public static final String SERIAL_PORT_PARAMETER = "serialPort";
83 public static final String IP_PROTOCOL_NAME = "IP";
84 public static final String SERIAL_PROTOCOL_NAME = "serial";
86 // List of all Channel names
87 public static final String POWER_CHANNEL = "power";
88 public static final String VOLUME_DIMMER_CHANNEL = "volumeDimmer";
89 public static final String VOLUME_DB_CHANNEL = "volumeDb";
90 public static final String MUTE_CHANNEL = "mute";
91 public static final String SET_INPUT_SOURCE_CHANNEL = "setInputSource";
92 public static final String LISTENING_MODE_CHANNEL = "listeningMode";
93 public static final String PLAYING_LISTENING_MODE_CHANNEL = "playingListeningMode";
94 public static final String DISPLAY_INFORMATION_CHANNEL = "displayInformation#displayInformation";
95 public static final String MCACC_MEMORY_CHANNEL = "MCACCMemory#MCACCMemory";
97 public static final String GROUP_CHANNEL_PATTERN = "zone%s#%s";
98 public static final Pattern GROUP_CHANNEL_ZONE_PATTERN = Pattern.compile("zone([0-4])#.*");
100 // Used for Discovery service
101 public static final String MANUFACTURER = "PIONEER";
102 public static final String UPNP_DEVICE_TYPE = "MediaRenderer";
104 public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Stream.of(IP_AVR_THING_TYPE,
105 IP_AVR_THING_TYPE2020, IP_AVR_THING_TYPE2019, IP_AVR_THING_TYPE2018, IP_AVR_THING_TYPE2017,
106 IP_AVR_THING_TYPE2016, IP_AVR_THING_TYPE2015, IP_AVR_THING_TYPE2014, IP_AVR_UNSUPPORTED_THING_TYPE)
107 .collect(Collectors.toSet());