Link via device on device page (#11554)

Co-authored-by: Zack Barett <arnett.zackary@gmail.com>
This commit is contained in:
Franck Nijhof 2022-02-05 04:16:01 +01:00 committed by GitHub
parent 45e6ec1ee2
commit 21d86f4797
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import {
computeDeviceName,
DeviceRegistryEntry,
} from "../../../../data/device_registry";
import { haStyle } from "../../../../resources/styles";
import { HomeAssistant } from "../../../../types";
import { loadDeviceRegistryDetailDialog } from "../device-registry-detail/show-dialog-device-registry-detail";
@ -55,10 +56,13 @@ export class HaDeviceCard extends LitElement {
"ui.panel.config.integrations.config_entry.via"
)}
<span class="hub"
><a
href="/config/devices/device/${this.device.via_device_id}"
>${this._computeDeviceName(
this.devices,
this.device.via_device_id
)}</span
)}</a
></span
>
</div>
`
@ -112,7 +116,9 @@ export class HaDeviceCard extends LitElement {
}
static get styles(): CSSResultGroup {
return css`
return [
haStyle,
css`
:host {
display: block;
}
@ -135,6 +141,7 @@ export class HaDeviceCard extends LitElement {
color: var(--secondary-text-color);
word-wrap: break-word;
}
`;
`,
];
}
}