mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-13 08:20:34 +00:00
Run pre-commit hooks over existing codebase
Co-Authored-By: Ben Phelps <ben@phelps.io>
This commit is contained in:
parent
fa50bbad9c
commit
19c25713c4
387 changed files with 4785 additions and 4109 deletions
|
@ -14,7 +14,7 @@ export default function Component({ service }) {
|
|||
if (opendtuError) {
|
||||
return <Container service={service} error={opendtuError} />;
|
||||
}
|
||||
|
||||
|
||||
if (!opendtuData) {
|
||||
return (
|
||||
<Container service={service}>
|
||||
|
@ -26,23 +26,35 @@ export default function Component({ service }) {
|
|||
);
|
||||
}
|
||||
|
||||
const yieldDay = opendtuData.total.YieldDay.v
|
||||
const yieldDayUnit = opendtuData.total.YieldDay.u
|
||||
const yieldDay = opendtuData.total.YieldDay.v;
|
||||
const yieldDayUnit = opendtuData.total.YieldDay.u;
|
||||
|
||||
const power = opendtuData.total.Power.v
|
||||
const powerUnit = opendtuData.total.Power.u
|
||||
const power = opendtuData.total.Power.v;
|
||||
const powerUnit = opendtuData.total.Power.u;
|
||||
|
||||
const totalLimit = opendtuData.inverters.map(inverter => inverter.limit_absolute).reduce((a,b) => a+b);
|
||||
const totalLimitUnit = "W"
|
||||
|
||||
const powerPercentage = (power / totalLimit) * 100
|
||||
const totalLimit = opendtuData.inverters.map((inverter) => inverter.limit_absolute).reduce((a, b) => a + b);
|
||||
const totalLimitUnit = "W";
|
||||
|
||||
const powerPercentage = (power / totalLimit) * 100;
|
||||
|
||||
return (
|
||||
<Container service={service}>
|
||||
<Block label="opendtu.yieldDay" value={`${t("common.number", { value: Math.round(yieldDay), style: "unit" })}${yieldDayUnit}`} />
|
||||
<Block label="opendtu.relativePower" value={t("common.number", { value: Math.round(powerPercentage), style: "unit", unit: "percent" })} />
|
||||
<Block label="opendtu.absolutePower" value={`${t("common.number", { value: Math.round(power), style: "unit" })}${powerUnit}`} />
|
||||
<Block label="opendtu.limit" value={`${t("common.number", { value: Math.round(totalLimit), style: "unit" })}${totalLimitUnit}`} />
|
||||
<Block
|
||||
label="opendtu.yieldDay"
|
||||
value={`${t("common.number", { value: Math.round(yieldDay), style: "unit" })}${yieldDayUnit}`}
|
||||
/>
|
||||
<Block
|
||||
label="opendtu.relativePower"
|
||||
value={t("common.number", { value: Math.round(powerPercentage), style: "unit", unit: "percent" })}
|
||||
/>
|
||||
<Block
|
||||
label="opendtu.absolutePower"
|
||||
value={`${t("common.number", { value: Math.round(power), style: "unit" })}${powerUnit}`}
|
||||
/>
|
||||
<Block
|
||||
label="opendtu.limit"
|
||||
value={`${t("common.number", { value: Math.round(totalLimit), style: "unit" })}${totalLimitUnit}`}
|
||||
/>
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue