Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.bigboxer23</groupId>
<artifactId>switchbotapi-java</artifactId>
<version>1.1.8</version>
<version>1.1.9</version>

<name>switchbotapi-java</name>
<url>https://github.com/bigboxer23/switchbotapi-java</url>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/bigboxer23/switch_bot/IDeviceTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ public interface IDeviceTypes {
String PLUG_MINI = "Plug Mini (US)";

String WATER_DETECTOR = "Water Detector";

String METER_PRO_CO2 = "MeterPro(CO2)";
}
5 changes: 4 additions & 1 deletion src/main/java/com/bigboxer23/switch_bot/data/Device.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ public class Device {

private float electricCurrent; // amps / 10

@Json(name = "status")

private int waterDetectorStatus;

@Json(name = "CO2")
private int co2;

public boolean isDry() {
return waterDetectorStatus == 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public void testDeviceStatus() throws IOException {
assertTrue(status.getElectricCurrent() > -1);
}
case IDeviceTypes.WATER_DETECTOR -> assertTrue(status.isWet());
case IDeviceTypes.METER_PRO_CO2 -> assertTrue(status.getCo2() > 0);
}
}
}
Expand Down
Loading