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.protocol.leap.dto;
15 import java.util.regex.Pattern;
17 import org.openhab.binding.lutron.internal.protocol.FanSpeedType;
18 import org.openhab.binding.lutron.internal.protocol.leap.AbstractMessageBody;
20 import com.google.gson.annotations.SerializedName;
23 * LEAP ZoneStatus Object
25 * @author Bob Adair - Initial contribution
27 public class ZoneStatus extends AbstractMessageBody {
28 public static final Pattern ZONE_HREF_PATTERN = Pattern.compile("/zone/([0-9]+)");
30 @SerializedName("href")
31 public String href = "";
32 @SerializedName("Level")
33 public int level; // 0-100
34 @SerializedName("SwitchedLevel")
35 public String switchedLevel = ""; // "On" or "Off"
36 @SerializedName("FanSpeed")
37 public FanSpeedType fanSpeed;
38 @SerializedName("Zone")
39 public Href zone = new Href();;
40 @SerializedName("StatusAccuracy")
41 public String statusAccuracy = ""; // "Good" or ??
46 public int getZone() {
48 return hrefNumber(ZONE_HREF_PATTERN, zone.href);
54 public boolean statusAccuracyGood() {
55 return "Good".equals(statusAccuracy);
58 public boolean switchedLevelOn() {
59 return "On".equals(switchedLevel);