2 * Copyright (c) 2010-2022 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.lgtvserial.internal.protocol.serial;
15 import java.io.IOException;
17 import org.openhab.core.thing.ChannelUID;
20 * This interface represents an LG serial command.
22 * @author Richard Lavoie - Initial contribution
24 public interface LGSerialCommand {
27 * Parse the response string into a response object. If null is returned, it means the result cannot be used to
28 * update a linked item state. This is useful to have one way commands.
30 * @param response Response to parse
31 * @return Response object
33 LGSerialResponse parseResponse(String response);
36 * This method is used to send the serial protocol command to the communicator.
38 * @param channel Channel related to the command
39 * @param comm Communicator linked to the serial port
40 * @param data Data related to this command to send over the wire. If null, this means we should send an FF state
44 void execute(ChannelUID channel, LGSerialCommunicator comm, Object data) throws IOException;