mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
parent
f7dbd38c2e
commit
a04e9b68bd
@ -40,6 +40,7 @@ import { loadVirtualizer } from "../../resources/virtualizer";
|
||||
import type { HomeAssistant } from "../../types";
|
||||
import { showConfirmationDialog } from "../generic/show-dialog-box";
|
||||
import { QuickBarMode, type QuickBarParams } from "./show-dialog-quick-bar";
|
||||
import { computeDeviceName } from "../../data/device_registry";
|
||||
|
||||
interface QuickBarItem extends ScorableTextItem {
|
||||
primaryText: string;
|
||||
@ -522,12 +523,14 @@ export class QuickBar extends LitElement {
|
||||
}
|
||||
|
||||
private _generateDeviceItems(): DeviceItem[] {
|
||||
return Object.keys(this.hass.devices)
|
||||
.map((deviceId) => {
|
||||
const device = this.hass.devices[deviceId];
|
||||
const area = this.hass.areas[device.area_id!];
|
||||
return Object.values(this.hass.devices)
|
||||
.filter((device) => !device.disabled_by)
|
||||
.map((device) => {
|
||||
const area = device.area_id
|
||||
? this.hass.areas[device.area_id]
|
||||
: undefined;
|
||||
const deviceItem = {
|
||||
primaryText: device.name!,
|
||||
primaryText: computeDeviceName(device, this.hass),
|
||||
deviceId: device.id,
|
||||
area: area?.name,
|
||||
action: () => navigate(`/config/devices/device/${device.id}`),
|
||||
|
Loading…
x
Reference in New Issue
Block a user