mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +00:00
Area card gallery updates (#11324)
This commit is contained in:
parent
6053b64b2e
commit
4165e64ce0
@ -46,7 +46,6 @@ const CONFIGS = [
|
|||||||
config: `
|
config: `
|
||||||
- type: area
|
- type: area
|
||||||
area: bedroom
|
area: bedroom
|
||||||
image: "/images/bed.png"
|
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -54,7 +53,6 @@ const CONFIGS = [
|
|||||||
config: `
|
config: `
|
||||||
- type: area
|
- type: area
|
||||||
area: living_room
|
area: living_room
|
||||||
image: "/images/living_room.png"
|
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -62,7 +60,6 @@ const CONFIGS = [
|
|||||||
config: `
|
config: `
|
||||||
- type: area
|
- type: area
|
||||||
area: office
|
area: office
|
||||||
image: "/images/office.jpg"
|
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -70,7 +67,6 @@ const CONFIGS = [
|
|||||||
config: `
|
config: `
|
||||||
- type: area
|
- type: area
|
||||||
area: kitchen
|
area: kitchen
|
||||||
image: "/images/kitchen.png"
|
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@ -93,18 +89,22 @@ class DemoArea extends LitElement {
|
|||||||
{
|
{
|
||||||
name: "Bedroom",
|
name: "Bedroom",
|
||||||
area_id: "bedroom",
|
area_id: "bedroom",
|
||||||
|
picture: "/images/bed.png",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Living Room",
|
name: "Living Room",
|
||||||
area_id: "living_room",
|
area_id: "living_room",
|
||||||
|
picture: "/images/living_room.png",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Office",
|
name: "Office",
|
||||||
area_id: "office",
|
area_id: "office",
|
||||||
|
picture: "/images/office.jpg",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Second Office",
|
name: "Second Office",
|
||||||
area_id: "kitchen",
|
area_id: "kitchen",
|
||||||
|
picture: "/images/kitchen.png",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
hass.mockWS("config/device_registry/list", () => []);
|
hass.mockWS("config/device_registry/list", () => []);
|
||||||
|
@ -31,6 +31,7 @@ import "../../../components/ha-card";
|
|||||||
import "../../../components/ha-icon-button";
|
import "../../../components/ha-icon-button";
|
||||||
import "../../../components/ha-state-icon";
|
import "../../../components/ha-state-icon";
|
||||||
import "../../../components/ha-svg-icon";
|
import "../../../components/ha-svg-icon";
|
||||||
|
import "../components/hui-image";
|
||||||
import {
|
import {
|
||||||
AreaRegistryEntry,
|
AreaRegistryEntry,
|
||||||
subscribeAreaRegistry,
|
subscribeAreaRegistry,
|
||||||
@ -265,7 +266,7 @@ export class HuiAreaCard
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
changedProps.has("_devicesInArea") ||
|
changedProps.has("_devicesInArea") ||
|
||||||
changedProps.has("_area") ||
|
changedProps.has("_areas") ||
|
||||||
changedProps.has("_entities")
|
changedProps.has("_entities")
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
@ -372,9 +373,7 @@ export class HuiAreaCard
|
|||||||
? html`<hui-image
|
? html`<hui-image
|
||||||
.config=${this._config}
|
.config=${this._config}
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.image=${area.picture
|
.image=${area.picture ? area.picture : undefined}
|
||||||
? this.hass.hassUrl(area.picture)
|
|
||||||
: undefined}
|
|
||||||
.cameraImage=${cameraEntityId}
|
.cameraImage=${cameraEntityId}
|
||||||
aspectRatio="16:9"
|
aspectRatio="16:9"
|
||||||
></hui-image>`
|
></hui-image>`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user