Skip to content

Commit 7805d0a

Browse files
committed
fix: serialize unit as symbol
1 parent b8ccfa5 commit 7805d0a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

metadata/src/main/java/net/laprun/sustainability/power/SensorMetadata.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,5 +235,10 @@ public ComponentMetadata(@JsonProperty("name") String name, @JsonProperty("index
235235
@JsonProperty("isAttributed") boolean isAttributed, @JsonProperty("unit") String unitSymbol) {
236236
this(name, index, description, isAttributed, SensorUnit.of(unitSymbol));
237237
}
238+
239+
@JsonProperty("unit")
240+
public String unitAsSymbol() {
241+
return unit.symbol();
242+
}
238243
}
239244
}

0 commit comments

Comments
 (0)