diff --git a/package.json b/package.json index a222ea24..43100cac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "battery-state-card", - "version": "1.4.0", + "version": "1.4.2", "description": "Battery State card for Home Assistant", "main": "dist/battery-state-card.js", "repository": { diff --git a/src/battery-vm.ts b/src/battery-vm.ts index 771866ee..c4f6a8a6 100644 --- a/src/battery-vm.ts +++ b/src/battery-vm.ts @@ -284,6 +284,10 @@ class BatteryViewModel { entityWithChargingState.attributes[exisitngAttrib.name] == exisitngAttrib.value : true; } + else { + // if there is no attribute indicating charging it means the charging state is false + return false; + } } const statesIndicatingCharging = safeGetArray(chargingConfig.state); diff --git a/src/utils.ts b/src/utils.ts index 545a51ac..fe1c31f3 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,7 +1,7 @@ import { HomeAssistant } from "./ha-types"; console.info( - "%c BATTERY-STATE-CARD %c 1.4.0", + "%c BATTERY-STATE-CARD %c 1.4.2", "color: white; background: forestgreen; font-weight: 700;", "color: forestgreen; background: white; font-weight: 700;", );