diff --git a/src/components/battery.ts b/src/components/battery.ts index 4c6fec2..5d1093e 100644 --- a/src/components/battery.ts +++ b/src/components/battery.ts @@ -57,17 +57,20 @@ export const batteryElement = ( })} ` : null} - void }) => { - main.openDetails(e, entities.battery?.state_of_charge!); - }} - @keyDown=${(e: { key: string; stopPropagation: () => void }) => { - if (e.key === "Enter") { - main.openDetails(e, entities.battery?.state_of_charge!); - } - }} - > + ${battery.icon !== " " + ? html` void }) => { + main.openDetails(e, entities.battery?.state_of_charge!); + }} + @keyDown=${(e: { key: string; stopPropagation: () => void }) => { + if (e.key === "Enter") { + main.openDetails(e, entities.battery?.state_of_charge!); + } + }} + />` + : null} ${entities.battery?.display_state === "two_way" || entities.battery?.display_state === undefined || (entities.battery?.display_state === "one_way_no_zero" && battery.state.toBattery > 0) || diff --git a/src/components/grid.ts b/src/components/grid.ts index 38e6cfc..0248439 100644 --- a/src/components/grid.ts +++ b/src/components/grid.ts @@ -37,7 +37,7 @@ export const gridElement = ( }} > ${generalSecondarySpan(main.hass, main, config, templatesObj, grid, "grid")} - + ${grid.icon !== " " ? html` ` : null} ${(entities.grid?.display_state === "two_way" || entities.grid?.display_state === undefined || (entities.grid?.display_state === "one_way_no_zero" && (grid.state.toGrid ?? 0) > 0) || diff --git a/src/components/home.ts b/src/components/home.ts index 9c40a48..fa0e28b 100644 --- a/src/components/home.ts +++ b/src/components/home.ts @@ -53,7 +53,7 @@ export const homeElement = ( }} > ${generalSecondarySpan(main.hass, main, config, templatesObj, home, "home")} - + ${home.icon !== " " ? html`` : null} ${homeUsageToDisplay} ${ diff --git a/src/components/individualLeftBottomElement.ts b/src/components/individualLeftBottomElement.ts index 1ad3e56..a68247b 100644 --- a/src/components/individualLeftBottomElement.ts +++ b/src/components/individualLeftBottomElement.ts @@ -63,7 +63,7 @@ export const individualLeftBottomElement = ( }} > ${individualSecondarySpan(hass, main, config, templatesObj, individualObj, indexOfIndividual, "left-bottom")} - + ${individualObj?.icon !== " " ? html` ` : null} ${individualObj?.field?.display_zero_state !== false || (individualObj?.state || 0) > (individualObj.displayZeroTolerance ?? 0) ? html` ${individualObj?.showDirection diff --git a/src/components/individualLeftTopElement.ts b/src/components/individualLeftTopElement.ts index c460b1b..ad8873e 100644 --- a/src/components/individualLeftTopElement.ts +++ b/src/components/individualLeftTopElement.ts @@ -38,7 +38,7 @@ export const individualLeftTopElement = ( }} > ${individualSecondarySpan(main.hass, main, config, templatesObj, individualObj, indexOfIndividual, "left-top")} - + ${individualObj.icon !== " " ? html` ` : null} ${individualObj?.field?.display_zero_state !== false || (individualObj.state || 0) > (individualObj.displayZeroTolerance ?? 0) ? html` ${individualObj?.showDirection diff --git a/src/components/individualRightBottomElement.ts b/src/components/individualRightBottomElement.ts index 91e8095..2605098 100644 --- a/src/components/individualRightBottomElement.ts +++ b/src/components/individualRightBottomElement.ts @@ -46,7 +46,7 @@ export const individualRightBottomElement = ( }} > ${individualSecondarySpan(main.hass, main, config, templatesObj, individualObj, indexOfIndividual, "right-bottom")} - + ${individualObj.icon !== " " ? html` ` : null} ${individualObj?.field?.display_zero_state !== false || (individualObj.state || 0) > (individualObj.displayZeroTolerance ?? 0) ? html` ${individualObj?.showDirection diff --git a/src/components/individualRightTopElement.ts b/src/components/individualRightTopElement.ts index 42bdc73..f4fa707 100644 --- a/src/components/individualRightTopElement.ts +++ b/src/components/individualRightTopElement.ts @@ -47,7 +47,7 @@ export const individualRightTopElement = ( }} > ${individualSecondarySpan(main.hass, main, config, templatesObj, individualObj, indexOfIndividual, "right-top")} - + ${individualObj.icon !== " " ? html` ` : null} ${individualObj?.field?.display_zero_state !== false || (individualObj.state || 0) > (individualObj.displayZeroTolerance ?? 0) ? html` ${individualObj?.showDirection diff --git a/src/components/nonFossil.ts b/src/components/nonFossil.ts index 5d21502..9c39f80 100644 --- a/src/components/nonFossil.ts +++ b/src/components/nonFossil.ts @@ -38,7 +38,7 @@ export const nonFossilElement = ( }} > ${generalSecondarySpan(main.hass, main, config, templatesObj, nonFossil, "low-carbon")} - + ${nonFossil.icon !== " " ? html` ` : null} ${entities.fossil_fuel_percentage?.display_zero_state !== false || (nonFossil.state.power || 0) > (entities.fossil_fuel_percentage?.display_zero_tolerance || 0) ? html` diff --git a/src/components/solar.ts b/src/components/solar.ts index 18944e0..d69222d 100644 --- a/src/components/solar.ts +++ b/src/components/solar.ts @@ -32,7 +32,7 @@ export const solarElement = ( }} > ${generalSecondarySpan(main.hass, main, config, templatesObj, solar, "solar")} - + ${solar.icon !== " " ? html` ` : null} ${entities.solar?.display_zero_state !== false || (solar.state.total || 0) > 0 ? html` ${displayValue(main.hass, config, solar.state.total, {