From c06fb70f62de4d58c13eed583e2283bcade4ec88 Mon Sep 17 00:00:00 2001 From: slipx06 Date: Tue, 18 Jul 2023 00:25:47 +0200 Subject: [PATCH] Update sunsynk-power-flow-card.js Round PV power to zero decimal places --- dist/sunsynk-power-flow-card.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index ea58a001..76e61dc8 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -870,24 +870,24 @@ class SunsynkPowerFlowCard extends LitElement { : svg`${aux_power < '0' ? aux_power *-1 : aux_power} W `} ${config.entities.pv1_power_186 !== 'none' ? svg` this.handlePopup(e, config.entities.pv1_power_186)}> - ${stateObj9.state ? stateObj9.state : '0'} W + ${parseFloat(stateObj9.state).toFixed(0) ? parseFloat(stateObj9.state).toFixed(0) : '0'} W ` - : svg`${stateObj9.state ? stateObj9.state : '0'} W`} + : svg`${parseFloat(stateObj9.state).toFixed(0) ? parseFloat(stateObj9.state).toFixed(0) : '0'} W`} ${config.entities.pv2_power_187 !== 'none' ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> - ${stateObj8.state ? stateObj8.state : '0'} W + ${parseFloat(stateObj8.state).toFixed(0) ? parseFloat(stateObj8.state).toFixed(0) : '0'} W ` - : svg`${stateObj8.state ? stateObj8.state : '0'} W`} + : svg`${parseFloat(stateObj8.state).toFixed(0) ? parseFloat(stateObj8.state).toFixed(0) : '0'} W`} ${config.entities.pv3_power_188 !== 'none' ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> - ${stateObj31.state ? stateObj31.state : '0'} W + ${parseFloat(stateObj31.state).toFixed(0) ? parseFloat(stateObj31.state).toFixed(0) : '0'} W ` - : svg`${stateObj31.state ? stateObj31.state : '0'} W`} + : svg`${parseFloat(stateObj31.state).toFixed(0) ? parseFloat(stateObj31.state).toFixed(0) : '0'} W`} ${config.entities.pv4_power_189 !== 'none' ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> - ${stateObj32.state ? stateObj32.state : '0'} W + ${parseFloat(stateObj32.state).toFixed(0) ? parseFloat(stateObj32.state).toFixed(0) : '0'} W ` - : svg`${stateObj32.state ? stateObj32.state : '0'} W`} + : svg`${parseFloat(stateObj32.state).toFixed(0) ? parseFloat(stateObj32.state).toFixed(0) : '0'} W`} this.handlePopup(e, config.entities.inverter_voltage_154)}> ${stateObj5.state ? stateObj5.state : '0'} V @@ -1240,24 +1240,24 @@ class SunsynkPowerFlowCard extends LitElement { ${config.entities.pv1_power_186 !== 'none' ? svg` this.handlePopup(e, config.entities.pv1_power_186)}> - ${stateObj9.state ? stateObj9.state : '0'} W + ${parseFloat(stateObj9.state).toFixed(0) ? parseFloat(stateObj9.state).toFixed(0) : '0'} W ` - : svg`${stateObj9.state ? stateObj9.state : '0'} W`} + : svg`${parseFloat(stateObj9.state).toFixed(0) ? parseFloat(stateObj9.state).toFixed(0) : '0'} W`} ${config.entities.pv2_power_187 !== 'none' ? svg` this.handlePopup(e, config.entities.pv2_power_187)}> - ${stateObj8.state ? stateObj8.state : '0'} W + ${parseFloat(stateObj8.state).toFixed(0) ? parseFloat(stateObj8.state).toFixed(0) : '0'} W ` - : svg`${stateObj8.state ? stateObj8.state : '0'} W`} + : svg`${parseFloat(stateObj8.state).toFixed(0) ? parseFloat(stateObj8.state).toFixed(0) : '0'} W`} ${config.entities.pv3_power_188 !== 'none' ? svg` this.handlePopup(e, config.entities.pv3_power_188)}> - ${stateObj31.state ? stateObj31.state : '0'} W + ${parseFloat(stateObj31.state).toFixed(0) ? parseFloat(stateObj31.state).toFixed(0) : '0'} W ` - : svg`${stateObj31.state ? stateObj31.state : '0'} W`} + : svg`${parseFloat(stateObj31.state).toFixed(0) ? parseFloat(stateObj31.state).toFixed(0) : '0'} W`} ${config.entities.pv4_power_189 !== 'none' ? svg` this.handlePopup(e, config.entities.pv4_power_189)}> - ${stateObj32.state ? stateObj32.state : '0'} W + ${parseFloat(stateObj32.state).toFixed(0) ? parseFloat(stateObj32.state).toFixed(0) : '0'} W ` - : svg`${stateObj32.state ? stateObj32.state : '0'} W`} + : svg`${parseFloat(stateObj32.state).toFixed(0) ? parseFloat(stateObj32.state).toFixed(0) : '0'} W`} ${config.entities.essential_power !== 'none' ? svg` this.handlePopup(e, config.entities.essential_power)}> ${essential ? essential : '0'} W