This commit is contained in:
Zack Arnett 2020-03-18 07:47:59 -04:00 committed by GitHub
parent ac911dcd31
commit 1d3aeec0de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,7 @@ import { PaperInputElement } from "@polymer/paper-input/paper-input";
import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element";
import { findEntities } from "../common/find-entites"; import { findEntities } from "../common/find-entites";
import { LovelaceConfig } from "../../../data/lovelace"; import { LovelaceConfig } from "../../../data/lovelace";
import { fireEvent } from "../../../common/dom/fire_event";
const ICONS = { const ICONS = {
armed_away: "hass:shield-lock", armed_away: "hass:shield-lock",
@ -173,6 +174,7 @@ class HuiAlarmPanelCard extends LitElement implements LovelaceCard {
class="${classMap({ [stateObj.state]: true })}" class="${classMap({ [stateObj.state]: true })}"
.icon="${ICONS[stateObj.state] || "hass:shield-outline"}" .icon="${ICONS[stateObj.state] || "hass:shield-outline"}"
.label="${this._stateIconLabel(stateObj.state)}" .label="${this._stateIconLabel(stateObj.state)}"
@click=${this._handleMoreInfo}
></ha-label-badge> ></ha-label-badge>
<div id="armActions" class="actions"> <div id="armActions" class="actions">
${(stateObj.state === "disarmed" ${(stateObj.state === "disarmed"
@ -260,6 +262,12 @@ class HuiAlarmPanelCard extends LitElement implements LovelaceCard {
input.value = ""; input.value = "";
} }
private _handleMoreInfo() {
fireEvent(this, "hass-more-info", {
entityId: this._config!.entity,
});
}
static get styles(): CSSResult { static get styles(): CSSResult {
return css` return css`
ha-card { ha-card {
@ -281,6 +289,7 @@ class HuiAlarmPanelCard extends LitElement implements LovelaceCard {
position: absolute; position: absolute;
right: 12px; right: 12px;
top: 12px; top: 12px;
cursor: pointer;
} }
.disarmed { .disarmed {