Search in sources :

Example 1 with DisplayOptionsParser

use of org.eclipse.smarthome.binding.homematic.internal.communicator.parser.DisplayOptionsParser in project smarthome by eclipse.

the class DisplayOptionsVirtualDatapointHandler method handleCommand.

@Override
public void handleCommand(VirtualGateway gateway, HmDatapoint dp, HmDatapointConfig dpConfig, Object value) throws IOException, HomematicClientException {
    HmChannel channel = dp.getChannel();
    DisplayOptionsParser rcOptionsParser = new DisplayOptionsParser(channel);
    rcOptionsParser.parse(value);
    if (StringUtils.isNotBlank(rcOptionsParser.getText())) {
        sendDatapoint(gateway, channel, DATAPOINT_NAME_TEXT, rcOptionsParser.getText());
    }
    sendDatapoint(gateway, channel, DATAPOINT_NAME_BEEP, rcOptionsParser.getBeep());
    sendDatapoint(gateway, channel, DATAPOINT_NAME_UNIT, rcOptionsParser.getUnit());
    sendDatapoint(gateway, channel, DATAPOINT_NAME_BACKLIGHT, rcOptionsParser.getBacklight());
    for (String symbol : rcOptionsParser.getSymbols()) {
        sendDatapoint(gateway, channel, symbol, Boolean.TRUE);
    }
    sendDatapoint(gateway, channel, DATAPOINT_NAME_SUBMIT, Boolean.TRUE);
    dp.setValue(value);
}
Also used : DisplayOptionsParser(org.eclipse.smarthome.binding.homematic.internal.communicator.parser.DisplayOptionsParser) HmChannel(org.eclipse.smarthome.binding.homematic.internal.model.HmChannel)

Aggregations

DisplayOptionsParser (org.eclipse.smarthome.binding.homematic.internal.communicator.parser.DisplayOptionsParser)1 HmChannel (org.eclipse.smarthome.binding.homematic.internal.model.HmChannel)1