diff --git a/gallery/src/pages/lovelace/picture-elements-card.ts b/gallery/src/pages/lovelace/picture-elements-card.ts index b524b4982bb0..4082f7cc17a0 100644 --- a/gallery/src/pages/lovelace/picture-elements-card.ts +++ b/gallery/src/pages/lovelace/picture-elements-card.ts @@ -27,7 +27,7 @@ const ENTITIES = [ }), getEntity("person", "paulus", "home", { friendly_name: "Paulus", - picture: "/images/paulus.jpg", + entity_picture: "/images/paulus.jpg", }), getEntity("sensor", "battery", 35, { device_class: "battery", diff --git a/gallery/src/pages/lovelace/picture-entity-card.ts b/gallery/src/pages/lovelace/picture-entity-card.ts index 6ba18e2a6931..d97f41774659 100644 --- a/gallery/src/pages/lovelace/picture-entity-card.ts +++ b/gallery/src/pages/lovelace/picture-entity-card.ts @@ -14,7 +14,7 @@ const ENTITIES = [ }), getEntity("person", "paulus", "home", { friendly_name: "Paulus", - picture: "/images/paulus.jpg", + entity_picture: "/images/paulus.jpg", }), ]; diff --git a/gallery/src/pages/lovelace/picture-glance-card.ts b/gallery/src/pages/lovelace/picture-glance-card.ts index e991ba7054b6..72cc32eaa754 100644 --- a/gallery/src/pages/lovelace/picture-glance-card.ts +++ b/gallery/src/pages/lovelace/picture-glance-card.ts @@ -22,7 +22,7 @@ const ENTITIES = [ }), getEntity("person", "paulus", "home", { friendly_name: "Paulus", - picture: "/images/paulus.jpg", + entity_picture: "/images/paulus.jpg", }), getEntity("sensor", "battery", 35, { device_class: "battery", diff --git a/src/data/person.ts b/src/data/person.ts index 9f2297d1ecfe..cbaabf2c007c 100644 --- a/src/data/person.ts +++ b/src/data/person.ts @@ -1,4 +1,7 @@ -import { HassEntityBase } from "home-assistant-js-websocket"; +import { + HassEntityAttributeBase, + HassEntityBase, +} from "home-assistant-js-websocket"; import { HomeAssistant } from "../types"; export interface BasePerson { @@ -19,8 +22,18 @@ export interface PersonMutableParams { picture: string | null; } +interface PersonEntityAttributes extends HassEntityAttributeBase { + id: string; + user_id?: string; + device_trackers?: string[]; + editable?: boolean; + gps_accuracy?: number; + latitude?: number; + longitude?: number; +} + export interface PersonEntity extends HassEntityBase { - attributes: Person; + attributes: PersonEntityAttributes; } export const fetchPersons = (hass: HomeAssistant) => diff --git a/src/panels/lovelace/cards/hui-picture-elements-card.ts b/src/panels/lovelace/cards/hui-picture-elements-card.ts index c0c3c6860a5e..243d9ec627b5 100644 --- a/src/panels/lovelace/cards/hui-picture-elements-card.ts +++ b/src/panels/lovelace/cards/hui-picture-elements-card.ts @@ -136,7 +136,7 @@ class HuiPictureElementsCard extends LitElement implements LovelaceCard { .image=${domain === "image" ? computeImageUrl(stateObj as ImageEntity) : domain === "person" - ? (stateObj as PersonEntity).attributes.picture + ? (stateObj as PersonEntity).attributes.entity_picture : this._config.image} .stateImage=${this._config.state_image} .stateFilter=${this._config.state_filter} diff --git a/src/panels/lovelace/cards/hui-picture-entity-card.ts b/src/panels/lovelace/cards/hui-picture-entity-card.ts index 46ddf9cbbfba..3ba47daa0762 100644 --- a/src/panels/lovelace/cards/hui-picture-entity-card.ts +++ b/src/panels/lovelace/cards/hui-picture-entity-card.ts @@ -149,7 +149,7 @@ class HuiPictureEntityCard extends LitElement implements LovelaceCard { .image=${domain === "image" ? computeImageUrl(stateObj as ImageEntity) : domain === "person" - ? (stateObj as PersonEntity).attributes.picture + ? (stateObj as PersonEntity).attributes.entity_picture : this._config.image} .stateImage=${this._config.state_image} .stateFilter=${this._config.state_filter} diff --git a/src/panels/lovelace/cards/hui-picture-glance-card.ts b/src/panels/lovelace/cards/hui-picture-glance-card.ts index 44b6a5f5b9b3..661c366fbe46 100644 --- a/src/panels/lovelace/cards/hui-picture-glance-card.ts +++ b/src/panels/lovelace/cards/hui-picture-glance-card.ts @@ -219,7 +219,7 @@ class HuiPictureGlanceCard extends LitElement implements LovelaceCard { .image=${domain === "image" ? computeImageUrl(stateObj as ImageEntity) : domain === "person" - ? (stateObj as PersonEntity).attributes.picture + ? (stateObj as PersonEntity).attributes.entity_picture : this._config.image} .stateImage=${this._config.state_image} .stateFilter=${this._config.state_filter}