]> git.basschouten.com Git - openhab-addons.git/blob
efcf8d0172a8ecff89f8402d0e99c6cc5ce9b052
[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.lgtvserial.internal.protocol.serial.commands;
14
15 import java.io.IOException;
16
17 import org.openhab.binding.lgtvserial.internal.protocol.serial.LGSerialCommand;
18 import org.openhab.binding.lgtvserial.internal.protocol.serial.LGSerialCommunicator;
19 import org.openhab.binding.lgtvserial.internal.protocol.serial.LGSerialResponse;
20 import org.openhab.core.thing.ChannelUID;
21
22 /**
23  * This command handles a raw command to be sent to the device.
24  *
25  * This proves useful when a command is not implemented yet to be able to send commands yourselves with the proper
26  * format.
27  *
28  * @author Richard Lavoie - Initial contribution
29  *
30  */
31 public class RawCommand implements LGSerialCommand {
32
33     @Override
34     public LGSerialResponse parseResponse(String response) {
35         return null;
36     }
37
38     @Override
39     public void execute(ChannelUID channel, LGSerialCommunicator comm, Object data) throws IOException {
40         // No read request possible
41         if (data != null) {
42             comm.write(this, data.toString(), channel);
43         }
44     }
45 }