]> git.basschouten.com Git - openhab-addons.git/blob
53976768133c26a1d5584db323195de2aad2e969
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.lutron.internal.protocol.leap.dto;
14
15 import java.util.regex.Pattern;
16
17 import org.openhab.binding.lutron.internal.protocol.leap.AbstractMessageBody;
18
19 import com.google.gson.annotations.SerializedName;
20
21 /**
22  * LEAP Area object
23  *
24  * @author Bob Adair - Initial contribution
25  */
26 public class Area extends AbstractMessageBody {
27     public static final Pattern AREA_HREF_PATTERN = Pattern.compile("/area/([0-9]+)");
28
29     @SerializedName("href")
30     public String href;
31
32     @SerializedName("Name")
33     public String name;
34
35     @SerializedName("Parent")
36     public Href parent;
37
38     // @SerializedName("Category")
39     // public Category category;
40
41     @SerializedName("AssociatedDevices")
42     public Href[] associatedDevices;
43
44     @SerializedName("AssociatedOccupancyGroups")
45     public Href[] associatedOccupancyGroups;
46
47     @SerializedName("LoadShedding")
48     public Href loadShedding;
49
50     @SerializedName("OccupancySettings")
51     public Href occupancySettings;
52
53     @SerializedName("OccupancySensorSettings")
54     public Href occupancySensorSettings;
55
56     @SerializedName("DaylightingGainSettings")
57     public Href daylightingGainSettings;
58
59     public Area() {
60     }
61
62     public int getArea() {
63         return hrefNumber(AREA_HREF_PATTERN, href);
64     }
65 }