mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-02 05:57:54 +00:00
more info (#5247)
This commit is contained in:
parent
ac911dcd31
commit
1d3aeec0de
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user