Skip to content

Commit 5e0e667

Browse files
authored
feat: add support for MeterPro(CO2) (#93)
1 parent ad2317e commit 5e0e667

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.bigboxer23</groupId>
66
<artifactId>switchbotapi-java</artifactId>
7-
<version>1.1.8</version>
7+
<version>1.1.9</version>
88

99
<name>switchbotapi-java</name>
1010
<url>https://github.com/bigboxer23/switchbotapi-java</url>

src/main/java/com/bigboxer23/switch_bot/IDeviceTypes.java

+2
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ public interface IDeviceTypes {
1111
String PLUG_MINI = "Plug Mini (US)";
1212

1313
String WATER_DETECTOR = "Water Detector";
14+
15+
String METER_PRO_CO2 = "MeterPro(CO2)";
1416
}

src/main/java/com/bigboxer23/switch_bot/data/Device.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ public class Device {
4141

4242
private float electricCurrent; // amps / 10
4343

44-
@Json(name = "status")
44+
4545
private int waterDetectorStatus;
4646

47+
@Json(name = "CO2")
48+
private int co2;
49+
4750
public boolean isDry() {
4851
return waterDetectorStatus == 0;
4952
}

src/test/java/com/bigboxer23/switch_bot/SwitchBotApiTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public void testDeviceStatus() throws IOException {
6666
assertTrue(status.getElectricCurrent() > -1);
6767
}
6868
case IDeviceTypes.WATER_DETECTOR -> assertTrue(status.isWet());
69+
case IDeviceTypes.METER_PRO_CO2 -> assertTrue(status.getCo2() > 0);
6970
}
7071
}
7172
}

0 commit comments

Comments
 (0)