Show battery charging state in the config panels (#6356)

This commit is contained in:
J. Nick Koston
2020-07-12 09:30:27 -10:00
committed by GitHub
parent def1ec3518
commit 3bc54aa9e0
6 changed files with 124 additions and 44 deletions

View File

@@ -0,0 +1,20 @@
import { batteryIcon } from "../../common/entity/battery_icon";
import "../ha-icon";
import { customElement, html, property, LitElement } from "lit-element";
@customElement("ha-battery-icon")
class HaBatteryIcon extends LitElement {
@property() public batteryStateObj;
@property() public batteryChargingStateObj;
protected render() {
return html`
<ha-icon
.icon=${batteryIcon(this.batteryStateObj, this.batteryChargingStateObj)}
></ha-icon>
`;
}
}
customElements.define("ha-battery-icon", HaBatteryIcon);