mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 02:49:51 +00:00
Show battery charging state in the config panels (#6356)
This commit is contained in:
20
src/components/entity/ha-battery-icon.ts
Normal file
20
src/components/entity/ha-battery-icon.ts
Normal 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);
|
||||
Reference in New Issue
Block a user