Use fallback for device name on device page (#5116)

* Use fallback for device name on device page

* Update ha-config-device-page.ts

* Lint
This commit is contained in:
Erik Montnemery 2020-03-09 21:09:27 +01:00 committed by GitHub
parent dd2163a837
commit 1f143176ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@ import {
} from "../../../data/entity_registry";
import {
DeviceRegistryEntry,
computeDeviceName,
updateDeviceRegistryEntry,
} from "../../../data/device_registry";
import { AreaRegistryEntry } from "../../../data/area_registry";
@ -124,7 +125,9 @@ export class HaConfigDevicePage extends LitElement {
${
this.narrow
? html`
<span slot="header">${device.name_by_user || device.name}</span>
<span slot="header">
${computeDeviceName(device, this.hass)}
</span>
`
: ""
}
@ -142,7 +145,7 @@ export class HaConfigDevicePage extends LitElement {
this.narrow
? ""
: html`
<h1>${device.name_by_user || device.name}</h1>
<h1>${computeDeviceName(device, this.hass)}</h1>
`
}
<ha-device-card