]> git.basschouten.com Git - openhab-addons.git/blob
faccc7809153f48017e026c1e691faa35ea6133f
[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.yamahareceiver.internal.protocol;
14
15 import static java.util.stream.Collectors.toSet;
16 import static org.openhab.binding.yamahareceiver.internal.YamahaReceiverBindingConstants.Inputs.*;
17
18 import java.io.IOException;
19 import java.util.Set;
20 import java.util.stream.Stream;
21
22 /**
23  * The preset control protocol interface
24  *
25  * @author David Graeff - Initial contribution
26  * @author Tomasz Maruszak - Adding Spotify, Server to supported preset inputs
27  */
28 public interface InputWithPresetControl extends IStateUpdatable {
29
30     int PRESET_CHANNELS = 40;
31
32     /**
33      * List all inputs that are compatible with this kind of control
34      */
35     Set<String> SUPPORTED_INPUTS = Stream.of(INPUT_TUNER, INPUT_NET_RADIO, INPUT_NET_RADIO_LEGACY, INPUT_USB,
36             INPUT_IPOD, INPUT_IPOD_USB, INPUT_DOCK, INPUT_PC, INPUT_NAPSTER, INPUT_PANDORA, INPUT_SIRIUS,
37             INPUT_RHAPSODY, INPUT_BLUETOOTH, INPUT_SPOTIFY, INPUT_SERVER, INPUT_HD_RADIO).collect(toSet());
38
39     /**
40      * Select a preset channel.
41      *
42      * @param presetChannel The preset position [1,40]
43      * @throws Exception
44      */
45     void selectItemByPresetNumber(int presetChannel) throws IOException, ReceivedMessageParseException;
46 }