mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Add model_id filter to device selector (#23746)
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
49379b49d0
commit
1b5f4d3432
@ -170,6 +170,7 @@ interface DeviceSelectorFilter {
|
|||||||
integration?: string;
|
integration?: string;
|
||||||
manufacturer?: string;
|
manufacturer?: string;
|
||||||
model?: string;
|
model?: string;
|
||||||
|
model_id?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeviceSelector {
|
export interface DeviceSelector {
|
||||||
@ -721,6 +722,7 @@ export const filterSelectorDevices = (
|
|||||||
const {
|
const {
|
||||||
manufacturer: filterManufacturer,
|
manufacturer: filterManufacturer,
|
||||||
model: filterModel,
|
model: filterModel,
|
||||||
|
model_id: filterModelId,
|
||||||
integration: filterIntegration,
|
integration: filterIntegration,
|
||||||
} = filterDevice;
|
} = filterDevice;
|
||||||
|
|
||||||
@ -732,6 +734,10 @@ export const filterSelectorDevices = (
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (filterModelId && device.model_id !== filterModelId) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (filterIntegration && deviceIntegrationLookup) {
|
if (filterIntegration && deviceIntegrationLookup) {
|
||||||
if (!deviceIntegrationLookup?.[device.id]?.has(filterIntegration)) {
|
if (!deviceIntegrationLookup?.[device.id]?.has(filterIntegration)) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user