diff --git a/src/components/flows/batteryGrid.ts b/src/components/flows/batteryGrid.ts index 918d5b7..e2d0bbc 100644 --- a/src/components/flows/batteryGrid.ts +++ b/src/components/flows/batteryGrid.ts @@ -4,7 +4,8 @@ import { showLine } from "../../utils/showLine"; import { html, svg } from "lit"; import { styleLine } from "../../utils/styleLine"; import { type Flows } from "./index"; -import { checkHasRightIndividual } from "../../utils/computeIndividualPosition"; +import { checkHasBottomIndividual, checkHasRightIndividual } from "../../utils/computeIndividualPosition"; +import { checkShouldShowDots } from "../../utils/checkShouldShowDots"; type FlowBatteryGridFlows = Pick>; @@ -12,7 +13,7 @@ export const flowBatteryGrid = (config: PowerFlowCardPlusConfig, { battery, grid return grid.has && battery.has && showLine(config, Math.max(grid.state.toBattery || 0, battery.state.toGrid || 0)) ? html`
i?.has), "multi-individual": checkHasRightIndividual(config, individual), })}" @@ -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`>; @@ -12,7 +13,7 @@ export const flowBatteryToHome = (config: PowerFlowCardPlusConfig, { battery, gr return battery.has && showLine(config, battery.state.toHome) ? html`
i?.has), "multi-individual": checkHasRightIndividual(config, individual), })}" @@ -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) ? html`
i?.has), "multi-individual": checkHasRightIndividual(config, individual), })}" @@ -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`>; @@ -12,7 +13,7 @@ export const flowSolarToBattery = (config: PowerFlowCardPlusConfig, { battery, i return battery.has && solar.has && showLine(config, solar.state.toBattery || 0) ? html`
i?.has), "multi-individual": checkHasRightIndividual(config, individual), })}" @@ -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) ? html`
i?.has), "multi-individual": checkHasRightIndividual(config, individual), })}" @@ -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; +}; diff --git a/src/utils/computeIndividualPosition.ts b/src/utils/computeIndividualPosition.ts index 1106752..650cc72 100644 --- a/src/utils/computeIndividualPosition.ts +++ b/src/utils/computeIndividualPosition.ts @@ -60,4 +60,4 @@ export const checkHasRightIndividual = (config: PowerFlowCardPlusConfig, individ !!getTopRightIndividual(config, individualObjs) || !!getBottomRightIndividual(config, individualObjs); export const checkHasBottomIndividual = (config: PowerFlowCardPlusConfig, individualObjs: IndividualObject[]): boolean => - !!getBottomLeftIndividual(config, individualObjs) || !!getBottomRightIndividual(config, individualObjs); + !!getBottomLeftIndividual(config, individualObjs) || !!getBottomRightIndividual(config, individualObjs); \ No newline at end of file