Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[homewizard] Fix NumberFormatException #17792

Merged
merged 3 commits into from
Nov 23, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ public class DataPayload {
private int longPowerFailCount;

@SerializedName("active_voltage_v")
private int activeVoltage;
private double activeVoltage;
@SerializedName("active_voltage_l1_v")
private int activeVoltageL1;
private double activeVoltageL1;
@SerializedName("active_voltage_l2_v")
private int activeVoltageL2;
private double activeVoltageL2;
@SerializedName("active_voltage_l3_v")
private int activeVoltageL3;
private double activeVoltageL3;

@SerializedName("active_current_a")
private double activeCurrent;
Expand Down Expand Up @@ -175,7 +175,7 @@ public int getLongPowerFailCount() {
*
* @return current active voltage
*/
public int getActiveVoltage() {
public double getActiveVoltage() {
return activeVoltage;
}

Expand All @@ -184,7 +184,7 @@ public int getActiveVoltage() {
*
* @return active voltage on phase 1
*/
public int getActiveVoltageL1() {
public double getActiveVoltageL1() {
return activeVoltageL1;
}

Expand All @@ -193,7 +193,7 @@ public int getActiveVoltageL1() {
*
* @return active voltage on phase 2
*/
public int getActiveVoltageL2() {
public double getActiveVoltageL2() {
return activeVoltageL2;
}

Expand All @@ -202,7 +202,7 @@ public int getActiveVoltageL2() {
*
* @return active voltage on phase 3
*/
public int getActiveVoltageL3() {
public double getActiveVoltageL3() {
return activeVoltageL3;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ public void deserializeResponse() throws IOException {
assertThat(key.getActivePowerL1W(), is(-676));
assertThat(key.getActivePowerL2W(), is(133));
assertThat(key.getActivePowerL3W(), is(18));
assertThat(key.getActiveVoltage(), is(220));
assertThat(key.getActiveVoltageL1(), is(221));
assertThat(key.getActiveVoltageL2(), is(222));
assertThat(key.getActiveVoltageL3(), is(223));
assertThat(key.getActiveVoltage(), is(220.0));
assertThat(key.getActiveVoltageL1(), is(221.0));
assertThat(key.getActiveVoltageL2(), is(222.0));
assertThat(key.getActiveVoltageL3(), is(223.0));
assertThat(key.getTotalEnergyExportT1Kwh(), is(8874.0));
assertThat(key.getTotalEnergyExportT2Kwh(), is(7788.0));
assertThat(key.getTotalEnergyImportT1Kwh(), is(10830.511));
Expand Down Expand Up @@ -80,10 +80,10 @@ public void deserializeResponseEmpty() throws IOException {
assertThat(key.getActivePowerL1W(), is(0));
assertThat(key.getActivePowerL2W(), is(0));
assertThat(key.getActivePowerL3W(), is(0));
assertThat(key.getActiveVoltage(), is(0));
assertThat(key.getActiveVoltageL1(), is(0));
assertThat(key.getActiveVoltageL2(), is(0));
assertThat(key.getActiveVoltageL3(), is(0));
assertThat(key.getActiveVoltage(), is(0.0));
assertThat(key.getActiveVoltageL1(), is(0.0));
assertThat(key.getActiveVoltageL2(), is(0.0));
assertThat(key.getActiveVoltageL3(), is(0.0));
assertThat(key.getAnyPowerFailCount(), is(0));
assertThat(key.getLongPowerFailCount(), is(0));
assertThat(key.getTotalEnergyExportT1Kwh(), is(0.0));
Expand Down