Add hardware version to the device info card (#10914)

This commit is contained in:
J. Nick Koston 2021-12-16 05:16:23 -06:00 committed by GitHub
parent 4ebdca2a46
commit 6f9b2ee569
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 0 deletions

View File

@ -206,6 +206,7 @@ const createDeviceRegistryEntries = (
model: "Mock Device",
name: "Tag Reader",
sw_version: null,
hw_version: "1.0.0",
id: "mock-device-id",
identifiers: [],
via_device_id: null,

View File

@ -13,6 +13,7 @@ export interface DeviceRegistryEntry {
model: string | null;
name: string | null;
sw_version: string | null;
hw_version: string | null;
via_device_id: string | null;
area_id: string | null;
name_by_user: string | null;

View File

@ -66,6 +66,17 @@ export class HaDeviceCard extends LitElement {
</div>
`
: ""}
${this.device.hw_version
? html`
<div class="extra-info">
${this.hass.localize(
"ui.panel.config.integrations.config_entry.hardware",
"version",
this.device.hw_version
)}
</div>
`
: ""}
<slot></slot>
</div>
<slot name="actions"></slot>

View File

@ -2444,6 +2444,7 @@
"manuf": "by {manufacturer}",
"via": "Connected via",
"firmware": "Firmware: {version}",
"hardware": "Hardware: {version}",
"unnamed_entry": "Unnamed entry",
"unknown_via_device": "Unknown device",
"area": "In {area}",