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.2.3</version>
<version>1.2.4</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 @@ -13,4 +13,6 @@ public interface IDeviceTypes {
String WATER_DETECTOR = "Water Detector";

String METER_PRO_CO2 = "MeterPro(CO2)";

String ROLLER_SHADE = "Roller Shade";
}
20 changes: 18 additions & 2 deletions src/main/java/com/bigboxer23/switch_bot/data/Device.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.squareup.moshi.Json;
import lombok.Data;

import java.util.List;

/** */
@Data
public class Device {
Expand All @@ -24,12 +26,20 @@ public class Device {

private boolean group;

private boolean master;

private String groupName;

private List<String> groupingDevicesIds;

private List<String> curtainDevicesIds;

private String openDirection;

private boolean moving;

private int slidePosition;

private boolean master;

private String power;

private float voltage;
Expand All @@ -46,6 +56,12 @@ public class Device {
@Json(name = "CO2")
private int co2;

private boolean calibrate;

private String hubDeviceId;

private boolean enableCloudService;

public boolean isDry() {
return waterDetectorStatus == 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ public void testDeviceStatus() throws IOException {
}
case IDeviceTypes.WATER_DETECTOR -> assertTrue(status.isWet() || status.isDry());
case IDeviceTypes.METER_PRO_CO2 -> assertTrue(status.getCo2() > 0);
case IDeviceTypes.ROLLER_SHADE -> {
assertTrue(status.isCalibrate());
assertNotNull(device.getGroupingDevicesIds());
assertNotNull(device.getGroupName());
}
}
}
}
Expand Down