Area card gallery updates (#11324)

This commit is contained in:
Zack Barett 2022-01-14 17:27:54 -06:00 committed by GitHub
parent 6053b64b2e
commit 4165e64ce0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

View File

@ -46,7 +46,6 @@ const CONFIGS = [
config: `
- type: area
area: bedroom
image: "/images/bed.png"
`,
},
{
@ -54,7 +53,6 @@ const CONFIGS = [
config: `
- type: area
area: living_room
image: "/images/living_room.png"
`,
},
{
@ -62,7 +60,6 @@ const CONFIGS = [
config: `
- type: area
area: office
image: "/images/office.jpg"
`,
},
{
@ -70,7 +67,6 @@ const CONFIGS = [
config: `
- type: area
area: kitchen
image: "/images/kitchen.png"
`,
},
];
@ -93,18 +89,22 @@ class DemoArea extends LitElement {
{
name: "Bedroom",
area_id: "bedroom",
picture: "/images/bed.png",
},
{
name: "Living Room",
area_id: "living_room",
picture: "/images/living_room.png",
},
{
name: "Office",
area_id: "office",
picture: "/images/office.jpg",
},
{
name: "Second Office",
area_id: "kitchen",
picture: "/images/kitchen.png",
},
]);
hass.mockWS("config/device_registry/list", () => []);

View File

@ -31,6 +31,7 @@ import "../../../components/ha-card";
import "../../../components/ha-icon-button";
import "../../../components/ha-state-icon";
import "../../../components/ha-svg-icon";
import "../components/hui-image";
import {
AreaRegistryEntry,
subscribeAreaRegistry,
@ -265,7 +266,7 @@ export class HuiAreaCard
if (
changedProps.has("_devicesInArea") ||
changedProps.has("_area") ||
changedProps.has("_areas") ||
changedProps.has("_entities")
) {
return true;
@ -372,9 +373,7 @@ export class HuiAreaCard
? html`<hui-image
.config=${this._config}
.hass=${this.hass}
.image=${area.picture
? this.hass.hassUrl(area.picture)
: undefined}
.image=${area.picture ? area.picture : undefined}
.cameraImage=${cameraEntityId}
aspectRatio="16:9"
></hui-image>`