]> git.basschouten.com Git - openhab-addons.git/blob
271e3b711e47c6b3ed24351dbd1bbe6a0c54eef5
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 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.tapocontrol.internal.structures;
14
15 import static org.openhab.binding.tapocontrol.internal.constants.TapoBindingSettings.MAC_DIVISION_CHAR;
16 import static org.openhab.binding.tapocontrol.internal.helpers.TapoUtils.formatMac;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19
20 /**
21  * Tapo Child Device Information class
22  *
23  * @author GaĆ«l L'hopital - Initial contribution
24  */
25 @NonNullByDefault
26 public class TapoChild {
27     private String fwVer = "";
28     private String hwVer = "";
29     private String type = "";
30     private String model = "";
31     private String mac = "";
32     private String category = "";
33     private String deviceId = "";
34     private boolean overheatStatus = false;
35     private int bindCount = 0;
36     private long onTime = 0;
37     private int slotNumber = 0;
38     private int position = 0;
39     private String nickname = "";
40     private boolean deviceOn = false;
41     private String region = "";
42
43     /***********************************
44      *
45      * GET VALUES
46      *
47      ************************************/
48
49     public String getFirmwareVersion() {
50         return fwVer;
51     }
52
53     public String getHardwareVersion() {
54         return hwVer;
55     }
56
57     public Boolean isOff() {
58         return !deviceOn;
59     }
60
61     public Boolean isOn() {
62         return deviceOn;
63     }
64
65     public String getMAC() {
66         return formatMac(mac, MAC_DIVISION_CHAR);
67     }
68
69     public String getModel() {
70         return model.replace(" Series", "");
71     }
72
73     public String getNickname() {
74         return nickname;
75     }
76
77     public Number getOnTime() {
78         return onTime;
79     }
80
81     public String getRegion() {
82         return region;
83     }
84
85     public String getRepresentationProperty() {
86         return getMAC();
87     }
88
89     public String getSerial() {
90         return deviceId;
91     }
92
93     public String getType() {
94         return type;
95     }
96
97     public String getFwVer() {
98         return fwVer;
99     }
100
101     public String getHwVer() {
102         return hwVer;
103     }
104
105     public String getMac() {
106         return mac;
107     }
108
109     public String getCategory() {
110         return category;
111     }
112
113     public String getDeviceId() {
114         return deviceId;
115     }
116
117     public Boolean getOverheatStatus() {
118         return overheatStatus;
119     }
120
121     public Integer getBindCount() {
122         return bindCount;
123     }
124
125     public Integer getSlotNumber() {
126         return slotNumber;
127     }
128
129     public Integer getPosition() {
130         return position;
131     }
132
133     public Boolean getDeviceOn() {
134         return deviceOn;
135     }
136
137     public void setDeviceOn(Boolean deviceOn) {
138         this.deviceOn = deviceOn;
139     }
140 }