Add model_id to device info card (#21417)

* Add model_id to device info card

* Update src/panels/config/devices/device-detail/ha-device-info-card.ts

Co-authored-by: Paul Bottein <paul.bottein@gmail.com>

* Add model_id to device info card

---------

Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
This commit is contained in:
Joost Lekkerkerker 2024-07-17 18:09:25 +02:00 committed by GitHub
parent 7468ab985a
commit 30d0293a4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 15 additions and 2 deletions

View File

@ -53,6 +53,7 @@ const DEVICES = [
identifiers: [["demo", "volume1"] as [string, string]],
manufacturer: null,
model: null,
model_id: null,
name_by_user: null,
name: "Dishwasher",
sw_version: null,
@ -72,6 +73,7 @@ const DEVICES = [
identifiers: [["demo", "pwm1"] as [string, string]],
manufacturer: null,
model: null,
model_id: null,
name_by_user: null,
name: "Lamp",
sw_version: null,
@ -91,6 +93,7 @@ const DEVICES = [
identifiers: [["demo", "pwm1"] as [string, string]],
manufacturer: null,
model: null,
model_id: null,
name_by_user: "User name",
name: "Technical name",
sw_version: null,

View File

@ -53,6 +53,7 @@ const DEVICES = [
identifiers: [["demo", "volume1"] as [string, string]],
manufacturer: null,
model: null,
model_id: null,
name_by_user: null,
name: "Dishwasher",
sw_version: null,
@ -72,6 +73,7 @@ const DEVICES = [
identifiers: [["demo", "pwm1"] as [string, string]],
manufacturer: null,
model: null,
model_id: null,
name_by_user: null,
name: "Lamp",
sw_version: null,
@ -91,6 +93,7 @@ const DEVICES = [
identifiers: [["demo", "pwm1"] as [string, string]],
manufacturer: null,
model: null,
model_id: null,
name_by_user: "User name",
name: "Technical name",
sw_version: null,

View File

@ -215,6 +215,7 @@ const createDeviceRegistryEntries = (
connections: [],
manufacturer: "ESPHome",
model: "Mock Device",
model_id: "ABC-001",
name: "Tag Reader",
sw_version: null,
hw_version: "1.0.0",

View File

@ -20,6 +20,7 @@ export interface DeviceRegistryEntry {
identifiers: Array<[string, string]>;
manufacturer: string | null;
model: string | null;
model_id: string | null;
name: string | null;
labels: string[];
sw_version: string | null;

View File

@ -31,8 +31,13 @@ export class HaDeviceCard extends LitElement {
>
<div class="card-content">
${this.device.model
? html`<div class="model">${this.device.model}</div>`
: ""}
? html`<div class="model">
${this.device.model}
${this.device.model_id ? html`(${this.device.model_id})` : ""}
</div>`
: this.device.model_id
? html`<div class="model">${this.device.model_id}</div>`
: ""}
${this.device.manufacturer
? html`
<div class="manuf">