Search in sources :

Example 1 with RemoteSession

use of de.quist.samy.remocon.RemoteSession in project openhab1-addons by openhab.

the class SamsungTvConnection method send.

/**
     * Sends a command to Samsung device.
     * 
     * @param cmd
     *            Command to send
     */
public void send(final String cmd) {
    RemoteSession remoteController = null;
    try {
        remoteController = RemoteSession.create("openHAB", "openHAB", ip, port);
        Key key = Key.valueOf(cmd);
        logger.debug("Try to send command: {}", cmd);
        remoteController.sendKey(key);
    } catch (Exception e) {
        logger.error("Could not send command to device on {}: {}", ip + ":" + port, e);
    }
    remoteController = null;
}
Also used : RemoteSession(de.quist.samy.remocon.RemoteSession) Key(de.quist.samy.remocon.Key)

Aggregations

Key (de.quist.samy.remocon.Key)1 RemoteSession (de.quist.samy.remocon.RemoteSession)1