Search in sources :

Example 11 with LcnAddrMod

use of org.openhab.binding.lcn.common.LcnAddrMod in project openhab1-addons by openhab.

the class ModSk method tryParseInput.

/**
     * Tries to parse the given input received from LCN-PCHK.
     * 
     * @param input the input
     * @return list of {@link ModSk} (might be empty, but not null}
     */
static Collection<Input> tryParseInput(String input) {
    LinkedList<Input> ret = new LinkedList<Input>();
    Matcher matcher = PckParser.PATTERN_SK_RESPONSE.matcher(input);
    if (matcher.matches()) {
        ret.add(new ModSk(new LcnAddrMod(Integer.parseInt(matcher.group("segId")), Integer.parseInt(matcher.group("modId"))), Integer.parseInt(matcher.group("id"))));
    }
    return ret;
}
Also used : Matcher(java.util.regex.Matcher) LinkedList(java.util.LinkedList) LcnAddrMod(org.openhab.binding.lcn.common.LcnAddrMod)

Aggregations

LcnAddrMod (org.openhab.binding.lcn.common.LcnAddrMod)11 Matcher (java.util.regex.Matcher)7 LinkedList (java.util.LinkedList)6 ModInfo (org.openhab.binding.lcn.connection.ModInfo)3 HashMap (java.util.HashMap)1 Map (java.util.Map)1 LcnAddrGrp (org.openhab.binding.lcn.common.LcnAddrGrp)1 LcnDefs (org.openhab.binding.lcn.common.LcnDefs)1 StringItem (org.openhab.core.library.items.StringItem)1 DecimalType (org.openhab.core.library.types.DecimalType)1 StringType (org.openhab.core.library.types.StringType)1 Command (org.openhab.core.types.Command)1 BindingConfigParseException (org.openhab.model.item.binding.BindingConfigParseException)1