Skip to content

Commit

Permalink
Merge pull request #127 from maxwroc/FixChargingIndicators
Browse files Browse the repository at this point in the history
Fixed charging indicators
  • Loading branch information
maxwroc authored Sep 4, 2020
2 parents 92745d1 + a561fe7 commit 4264c91
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
4 changes: 4 additions & 0 deletions src/battery-vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
@@ -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;",
);
Expand Down

0 comments on commit 4264c91

Please sign in to comment.