Skip to content

Commit

Permalink
feat: exposing more information about equipment (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
bigboxer23 authored Oct 1, 2024
1 parent 13fa69e commit 2c221fe
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/main/java/com/bigboxer23/eco_net/data/Constraints.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.bigboxer23.eco_net.data;

import com.squareup.moshi.Json;
import java.util.List;
import lombok.Data;

/** */
@Data
public class Constraints {
@Json(name = "enumText")
private List<String> modes;
}
11 changes: 10 additions & 1 deletion src/main/java/com/bigboxer23/eco_net/data/Equipment.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@Data
public class Equipment {
@Json(name = "device_name")
private String name;
private String deviceName;

@Json(name = "device_type")
private String type;
Expand All @@ -17,4 +17,13 @@ public class Equipment {

@Json(name = "serial_number")
private String serialNumber;

@Json(name = "@SETPOINT")
private ValueHolder<Integer> setpoint;

@Json(name = "@NAME")
private ValueHolder<String> name;

@Json(name = "@MODE")
private Modes modes;
}
13 changes: 13 additions & 0 deletions src/main/java/com/bigboxer23/eco_net/data/Modes.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.bigboxer23.eco_net.data;

import com.squareup.moshi.Json;
import lombok.Data;

/** */
@Data
public class Modes {
private Constraints constraints;

@Json(name = "status")
private String activeMode;
}
9 changes: 9 additions & 0 deletions src/main/java/com/bigboxer23/eco_net/data/ValueHolder.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.bigboxer23.eco_net.data;

import lombok.Data;

/** */
@Data
public class ValueHolder<T> {
private T value;
}
8 changes: 8 additions & 0 deletions src/test/java/com/bigboxer23/eco_net/EcoNetApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,13 @@ public void getUserData() {
.getEquipments()
.get(0)
.getType());
assertNotNull(result.get()
.getResults()
.getLocations()
.get(0)
.getEquipments()
.get(0)
.getSetpoint()
.getValue());
}
}

0 comments on commit 2c221fe

Please sign in to comment.