mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-12 20:06:33 +00:00
Don't use advanced mode in hardware dialog (#25051)
This commit is contained in:
parent
53426d647a
commit
74741c5d69
@ -16,23 +16,14 @@ import type { HomeAssistant } from "../../../../src/types";
|
|||||||
import type { HassioHardwareDialogParams } from "./show-dialog-hassio-hardware";
|
import type { HassioHardwareDialogParams } from "./show-dialog-hassio-hardware";
|
||||||
|
|
||||||
const _filterDevices = memoizeOne(
|
const _filterDevices = memoizeOne(
|
||||||
(
|
(hardware: HassioHardwareInfo, filter: string, language: string) =>
|
||||||
showAdvanced: boolean,
|
|
||||||
hardware: HassioHardwareInfo,
|
|
||||||
filter: string,
|
|
||||||
language: string
|
|
||||||
) =>
|
|
||||||
hardware.devices
|
hardware.devices
|
||||||
.filter(
|
.filter(
|
||||||
(device) =>
|
(device) =>
|
||||||
(showAdvanced ||
|
device.by_id?.toLowerCase().includes(filter) ||
|
||||||
["tty", "gpio", "input"].includes(device.subsystem)) &&
|
|
||||||
(device.by_id?.toLowerCase().includes(filter) ||
|
|
||||||
device.name.toLowerCase().includes(filter) ||
|
device.name.toLowerCase().includes(filter) ||
|
||||||
device.dev_path.toLocaleLowerCase().includes(filter) ||
|
device.dev_path.toLocaleLowerCase().includes(filter) ||
|
||||||
JSON.stringify(device.attributes)
|
JSON.stringify(device.attributes).toLocaleLowerCase().includes(filter)
|
||||||
.toLocaleLowerCase()
|
|
||||||
.includes(filter))
|
|
||||||
)
|
)
|
||||||
.sort((a, b) => stringCompare(a.name, b.name, language))
|
.sort((a, b) => stringCompare(a.name, b.name, language))
|
||||||
);
|
);
|
||||||
@ -60,7 +51,6 @@ class HassioHardwareDialog extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const devices = _filterDevices(
|
const devices = _filterDevices(
|
||||||
this.hass.userData?.showAdvanced || false,
|
|
||||||
this._dialogParams.hardware,
|
this._dialogParams.hardware,
|
||||||
(this._filter || "").toLowerCase(),
|
(this._filter || "").toLowerCase(),
|
||||||
this.hass.locale.language
|
this.hass.locale.language
|
||||||
|
Loading…
x
Reference in New Issue
Block a user