diff --git a/src/components/flows/batteryGrid.ts b/src/components/flows/batteryGrid.ts index cd21990..e2d0bbc 100644 --- a/src/components/flows/batteryGrid.ts +++ b/src/components/flows/batteryGrid.ts @@ -5,6 +5,7 @@ import { html, svg } from "lit"; import { styleLine } from "../../utils/styleLine"; import { type Flows } from "./index"; import { checkHasBottomIndividual, checkHasRightIndividual } from "../../utils/computeIndividualPosition"; +import { checkShouldShowDots } from "../../utils/checkShouldShowDots"; type FlowBatteryGridFlows = Pick>; @@ -24,7 +25,7 @@ export const flowBatteryGrid = (config: PowerFlowCardPlusConfig, { battery, grid d="M45,100 v-15 c0,-30 -10,-30 -30,-30 h-20" vector-effect="non-scaling-stroke" > - ${grid.state.toBattery + ${checkShouldShowDots(config) && grid.state.toBattery ? svg`>; @@ -24,7 +25,7 @@ export const flowBatteryToHome = (config: PowerFlowCardPlusConfig, { battery, gr d="M55,100 v-${grid.has ? 15 : 17} c0,-30 10,-30 30,-30 h20" vector-effect="non-scaling-stroke" > - ${battery.state.toHome + ${checkShouldShowDots(config) && battery.state.toHome ? svg` { return grid.has && showLine(config, grid.state.fromGrid) @@ -22,7 +23,7 @@ export const flowGridToHome = (config: PowerFlowCardPlusConfig, { battery, grid, d="M0,${battery.has ? 50 : solar.has ? 56 : 53} H100" vector-effect="non-scaling-stroke" > - ${grid.state.toHome + ${checkShouldShowDots(config) && grid.state.toHome ? svg`>; @@ -24,7 +25,7 @@ export const flowSolarToBattery = (config: PowerFlowCardPlusConfig, { battery, i d="M50,0 V100" vector-effect="non-scaling-stroke" > - ${solar.state.toBattery + ${checkShouldShowDots(config) && solar.state.toBattery ? svg` { return grid.hasReturnToGrid && solar.has && showLine(config, solar.state.toGrid || 0) @@ -22,7 +23,7 @@ export const flowSolarToGrid = (config: PowerFlowCardPlusConfig, { battery, grid d="M${battery.has ? 45 : 47},0 v15 c0,${battery.has ? "30 -10,30 -30,30" : "35 -10,35 -30,35"} h-20" vector-effect="non-scaling-stroke" > - ${solar.state.toGrid && solar.has + ${checkShouldShowDots(config) && solar.state.toGrid && solar.has ? svg` { return solar.has && showLine(config, solar.state.toHome || 0) @@ -22,7 +23,7 @@ export const flowSolarToHome = (config: PowerFlowCardPlusConfig, { battery, grid d="M${battery.has ? 55 : 53},0 v${grid.has ? 15 : 17} c0,${battery.has ? "30 10,30 30,30" : "35 10,35 30,35"} h25" vector-effect="non-scaling-stroke" > - ${solar.state.toHome + ${checkShouldShowDots(config) && solar.state.toHome ? svg` - ${individualObj?.state + ${checkShouldShowDots(config) && individualObj?.state ? svg` - ${individualObj.state + ${checkShouldShowDots(config) && individualObj.state ? svg` - ${individualObj.state + ${checkShouldShowDots(config) && individualObj.state ? svg` - ${individualObj.state + ${checkShouldShowDots(config) && individualObj.state ? svg` - ${nonFossil.has + ${checkShouldShowDots(config) && nonFossil.has ? svg` { + return config.disable_dots !== true; +};