Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/panels/lovelace/cards/hui-picture-elements-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,14 @@ class HuiPictureElementsCard extends LitElement implements LovelaceCard {
<ha-card .header="${this._config.title}">
<div id="root">
<hui-image
.hass="${this._hass}"
.image="${this._config.image}"
.stateImage="${this._config.state_image}"
.cameraImage="${this._config.camera_image}"
.cameraView="${this._config.camera_view}"
.entity="${this._config.entity}"
.aspectRatio="${this._config.aspect_ratio}"
.hass=${this._hass}
.image=${this._config.image}
.stateImage=${this._config.state_image}
.stateFilter=${this._config.state_filter}
.cameraImage=${this._config.camera_image}
.cameraView=${this._config.camera_view}
.entity=${this._config.entity}
.aspectRatio=${this._config.aspect_ratio}
></hui-image>
${this._config.elements.map(
(elementConfig: LovelaceElementConfig) => {
Expand Down
27 changes: 14 additions & 13 deletions src/panels/lovelace/cards/hui-picture-entity-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,22 @@ class HuiPictureEntityCard extends LitElement implements LovelaceCard {
return html`
<ha-card>
<hui-image
.hass="${this.hass}"
.image="${this._config.image}"
.stateImage="${this._config.state_image}"
.cameraImage="${computeDomain(this._config.entity) === "camera"
.hass=${this.hass}
.image=${this._config.image}
.stateImage=${this._config.state_image}
.stateFilter=${this._config.state_filter}
.cameraImage=${computeDomain(this._config.entity) === "camera"
? this._config.entity
: this._config.camera_image}"
.cameraView="${this._config.camera_view}"
.entity="${this._config.entity}"
.aspectRatio="${this._config.aspect_ratio}"
@ha-click="${this._handleTap}"
@ha-hold="${this._handleHold}"
.longPress="${longPress()}"
class="${classMap({
: this._config.camera_image}
.cameraView=${this._config.camera_view}
.entity=${this._config.entity}
.aspectRatio=${this._config.aspect_ratio}
@ha-click=${this._handleTap}
@ha-hold=${this._handleHold}
.longPress=${longPress()}
class=${classMap({
clickable: stateObj.state !== UNAVAILABLE,
})}"
})}
></hui-image>
${footer}
</ha-card>
Expand Down
21 changes: 11 additions & 10 deletions src/panels/lovelace/cards/hui-picture-glance-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,17 @@ class HuiPictureGlanceCard extends LitElement implements LovelaceCard {
this._config.camera_image
),
})}"
@ha-click="${this._handleTap}"
@ha-hold="${this._handleHold}"
.longPress="${longPress()}"
.hass="${this.hass}"
.image="${this._config.image}"
.stateImage="${this._config.state_image}"
.cameraImage="${this._config.camera_image}"
.cameraView="${this._config.camera_view}"
.entity="${this._config.entity}"
.aspectRatio="${this._config.aspect_ratio}"
@ha-click=${this._handleTap}
@ha-hold=${this._handleHold}
.longPress=${longPress()}
.hass=${this.hass}
.image=${this._config.image}
.stateImage=${this._config.state_image}
.stateFilter=${this._config.state_filter}
.cameraImage=${this._config.camera_image}
.cameraView=${this._config.camera_view}
.entity=${this._config.entity}
.aspectRatio=${this._config.aspect_ratio}
></hui-image>
<div class="box">
${this._config.title
Expand Down
3 changes: 3 additions & 0 deletions src/panels/lovelace/cards/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export interface PictureElementsCardConfig extends LovelaceCardConfig {
camera_image?: string;
camera_view?: HuiImage["cameraView"];
state_image?: {};
state_filter: string[];
aspect_ratio?: string;
entity?: string;
elements: LovelaceElementConfig[];
Expand All @@ -156,6 +157,7 @@ export interface PictureEntityCardConfig extends LovelaceCardConfig {
camera_image?: string;
camera_view?: HuiImage["cameraView"];
state_image?: {};
state_filter: string[];
aspect_ratio?: string;
tap_action?: ActionConfig;
hold_action?: ActionConfig;
Expand All @@ -170,6 +172,7 @@ export interface PictureGlanceCardConfig extends LovelaceCardConfig {
camera_image?: string;
camera_view?: HuiImage["cameraView"];
state_image?: {};
state_filter: string[];
aspect_ratio?: string;
entity?: string;
tap_action?: ActionConfig;
Expand Down