2 * Copyright (c) 2010-2023 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.lutron.internal.radiora.protocol;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
20 * Feedback that gives the state of all zones
32 * Zones 2 and 9 are ON, all others are OFF, and Zones 31 and 32 are unassigned.
33 * In a bridged system, a system parameter S1 or S2 will be appended.
36 * ZMP,010000001000000000000000000000XX
37 * ZMP,00100000010000000000000000000000,S2
40 * @author Jeff Lauterbach - Initial Contribution
44 public class ZoneMapFeedback extends RadioRAFeedback {
45 private final Logger logger = LoggerFactory.getLogger(ZoneMapFeedback.class);
47 private String zoneStates; // 32 bit String of (0,1,X)
48 private int system; // 1 or 2, or 0 for none
50 public ZoneMapFeedback(String msg) {
51 String[] params = parse(msg, 1);
53 zoneStates = params[1];
56 if (params.length > 2) {
57 String sysParam = params[2].trim().toUpperCase();
58 if ("S1".equals(sysParam)) {
60 } else if ("S2".equals(sysParam)) {
63 logger.debug("Invalid 2nd parameter {} in ZMP message. Should be S1 or S2.", sysParam);
68 public String getZoneStates() {
72 public char getZoneValue(int zone) {
73 if (zone < 1 || zone > zoneStates.length()) {
77 return zoneStates.charAt(zone - 1);
80 public int getSystem() {