Search in sources :

Example 1 with ClearCommand

use of org.openhab.binding.hyperion.internal.protocol.v1.ClearCommand in project openhab-addons by openhab.

the class HyperionHandler method handleClear.

private void handleClear(Command command) throws IOException, CommandUnsuccessfulException {
    if (command instanceof StringType) {
        String cmd = command.toString();
        if ("ALL".equals(cmd)) {
            ClearAllCommand clearCommand = new ClearAllCommand();
            sendCommand(clearCommand);
        } else {
            int priority = Integer.parseInt(cmd);
            ClearCommand clearCommand = new ClearCommand(priority);
            sendCommand(clearCommand);
        }
    }
}
Also used : StringType(org.openhab.core.library.types.StringType) ClearCommand(org.openhab.binding.hyperion.internal.protocol.v1.ClearCommand) ClearAllCommand(org.openhab.binding.hyperion.internal.protocol.v1.ClearAllCommand)

Example 2 with ClearCommand

use of org.openhab.binding.hyperion.internal.protocol.v1.ClearCommand in project openhab-addons by openhab.

the class HyperionNgHandler method handleClear.

private void handleClear(Command command) throws IOException, CommandUnsuccessfulException {
    if (command instanceof StringType) {
        String cmd = command.toString();
        if ("ALL".equals(cmd)) {
            ClearAllCommand clearCommand = new ClearAllCommand();
            sendCommand(clearCommand);
        } else {
            int priority = Integer.parseInt(cmd);
            ClearCommand clearCommand = new ClearCommand(priority);
            sendCommand(clearCommand);
        }
    }
}
Also used : StringType(org.openhab.core.library.types.StringType) ClearCommand(org.openhab.binding.hyperion.internal.protocol.v1.ClearCommand) ClearAllCommand(org.openhab.binding.hyperion.internal.protocol.v1.ClearAllCommand)

Aggregations

ClearAllCommand (org.openhab.binding.hyperion.internal.protocol.v1.ClearAllCommand)2 ClearCommand (org.openhab.binding.hyperion.internal.protocol.v1.ClearCommand)2 StringType (org.openhab.core.library.types.StringType)2