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.sonyaudio.internal.handler;
15 import org.eclipse.jetty.websocket.client.WebSocketClient;
16 import org.openhab.core.library.types.StringType;
17 import org.openhab.core.thing.Thing;
18 import org.openhab.core.types.Command;
21 * The {@link HtCt800Handler} is responsible for handling commands for HT-CT800, which are
22 * sent to one of the channels.
24 * @author David Ã…berg - Initial contribution
26 public class HtCt800Handler extends SonyAudioHandler {
28 public HtCt800Handler(Thing thing, WebSocketClient webSocketClient) {
29 super(thing, webSocketClient);
33 public String setInputCommand(Command command) {
34 switch (command.toString().toLowerCase()) {
36 return "extInput:btAudio";
40 return "extInput:hdmi?port=1";
42 return "extInput:hdmi?port=2";
44 return "extInput:hdmi?port=3";
46 return "extInput:line";
48 return "storage:usb1";
54 return command.toString();
58 public StringType inputSource(String input) {
59 String in = input.toLowerCase();
60 if (in.contains("extinput:btaudio".toLowerCase())) {
61 return new StringType("btaudio");
63 if (in.contains("extinput:tv".toLowerCase())) {
64 return new StringType("tv");
66 if (in.contains("extinput:hdmi?port=1".toLowerCase())) {
67 return new StringType("hdmi1");
69 if (in.contains("extinput:hdmi?port=2".toLowerCase())) {
70 return new StringType("hdmi2");
72 if (in.contains("extinput:hdmi?port=3".toLowerCase())) {
73 return new StringType("hdmi3");
75 if (in.contains("extinput:line".toLowerCase())) {
76 return new StringType("analog");
78 if (in.contains("storage:usb1".toLowerCase())) {
79 return new StringType("usb");
81 if (in.contains("dlna:music".toLowerCase())) {
82 return new StringType("network");
84 if (in.contains("cast:audio".toLowerCase())) {
85 return new StringType("cast");
87 return new StringType(input);