Skip to content

Commit

Permalink
Merge pull request #16 from Brovning/beta
Browse files Browse the repository at this point in the history
#15 Uncaught type error in public functions
  • Loading branch information
Brovning committed Jan 21, 2022
2 parents a6dbcdd + 6e8143a commit cca85f3
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions e3dc/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -2103,7 +2103,7 @@ public function GetBatteryPowerIntervalW(int $timeIntervalInMinutes): int
$returnValue = $this->GetVariableValue($varIdent, "Value");
}

return round($returnValue);
return (int)round($returnValue);
}

public function GetBatteryPowerKw(): float
Expand All @@ -2122,7 +2122,7 @@ public function GetBatteryChargeEnergyWh(int $startTime, int $endTime): int

$returnValue = $this->getPowerSumOfLog($this->GetVariableId($varIdent, "Value"), $startTime, $endTime, 1);

return round($returnValue);
return (int)round($returnValue);
}

public function GetBatteryChargeEnergyKwh(int $startTime, int $endTime): float
Expand All @@ -2136,7 +2136,7 @@ public function GetBatteryDischargeEnergyWh(int $startTime, int $endTime): int

$returnValue = $this->getPowerSumOfLog($this->GetVariableId($varIdent, "Value"), $startTime, $endTime, 2);

return abs(round($returnValue));
return (int)abs(round($returnValue));
}

public function GetBatteryDischargeEnergyKwh(int $startTime, int $endTime): float
Expand Down Expand Up @@ -2195,7 +2195,7 @@ public function GetExtPowerIntervalW(int $timeIntervalInMinutes): int
$returnValue = $this->GetVariableValue($varIdent, "Value");
}

return abs(round($returnValue));
return (int)abs(round($returnValue));
}

public function GetExtPowerKw(): float
Expand Down Expand Up @@ -2223,7 +2223,7 @@ public function GetExtEnergyWh(int $startTime, int $endTime): int
$returnValue = $this->getPowerSumOfLog($this->GetVariableId($varIdent, "Value"), $startTime, $endTime);
}

return abs(round($returnValue));
return (int)abs(round($returnValue));
}

public function GetExtEnergyKwh(int $startTime, int $endTime): float
Expand Down Expand Up @@ -2266,7 +2266,7 @@ public function GetProductionEnergyWh(int $startTime, int $endTime): int
$returnValue = $this->GetPvEnergyWh($startTime, $endTime);
}

return round($returnValue);
return (int)round($returnValue);
}

public function GetProductionEnergyKwh(int $startTime, int $endTime): float
Expand All @@ -2292,7 +2292,7 @@ public function GetGridPowerIntervalW(int $timeIntervalInMinutes): int
$returnValue = $this->GetVariableValue($varIdent, "Value");
}

return round($returnValue);
return (int)round($returnValue);
}

public function GetGridPowerKw(): float
Expand All @@ -2311,7 +2311,7 @@ public function GetGridConsumptionEnergyWh(int $startTime, int $endTime): int

$returnValue = $this->getPowerSumOfLog($this->GetVariableId($varIdent, "Value"), $startTime, $endTime, 1);

return round($returnValue);
return (int)round($returnValue);
}

public function GetGridConsumptionEnergyKwh(int $startTime, int $endTime): float
Expand All @@ -2325,7 +2325,7 @@ public function GetGridFeedEnergyWh(int $startTime, int $endTime): int

$returnValue = $this->getPowerSumOfLog($this->GetVariableId($varIdent, "Value"), $startTime, $endTime, 2);

return abs(round($returnValue));
return (int)abs(round($returnValue));
}

public function GetGridFeedEnergyKwh(int $startTime, int $endTime): float
Expand All @@ -2351,7 +2351,7 @@ public function GetPvPowerIntervalW(int $timeIntervalInMinutes): int
$returnValue = $this->GetVariableValue($varIdent, "Value");
}

return abs(round($returnValue));
return (int)abs(round($returnValue));
}

public function GetPvPowerKw(): float
Expand All @@ -2370,7 +2370,7 @@ public function GetPvEnergyWh(int $startTime, int $endTime): int

$returnValue = $this->getPowerSumOfLog($this->GetVariableId($varIdent, "Value"), $startTime, $endTime);

return abs(round($returnValue));
return (int)abs(round($returnValue));
}

public function GetPvEnergyKwh(int $startTime, int $endTime): float
Expand Down Expand Up @@ -2415,7 +2415,7 @@ public function GetHomeEnergyWh(int $startTime, int $endTime): int

$returnValue = $this->getPowerSumOfLog($this->GetVariableId($varIdent, "Value"), $startTime, $endTime);

return round($returnValue);
return (int)round($returnValue);
}

public function GetHomeEnergyKwh(int $startTime, int $endTime): float
Expand Down Expand Up @@ -2489,7 +2489,7 @@ public function GetWallboxEnergyWh(int $startTime, int $endTime): int
$returnValue = $this->getPowerSumOfLog($this->GetVariableId($varIdent, "Value"), $startTime, $endTime);
}

return round($returnValue);
return (int)round($returnValue);
}

public function GetWallboxEnergyKwh(int $startTime, int $endTime): float
Expand Down Expand Up @@ -2563,7 +2563,7 @@ public function GetWallboxSolarEnergyWh(int $startTime, int $endTime): int
$returnValue = $this->getPowerSumOfLog($this->GetVariableId($varIdent, "Value"), $startTime, $endTime);
}

return abs(round($returnValue));
return (int)abs(round($returnValue));
}

public function GetWallboxSolarEnergyKwh(int $startTime, int $endTime): float
Expand Down

0 comments on commit cca85f3

Please sign in to comment.