mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46: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;
|
||||
manufacturer?: string;
|
||||
model?: string;
|
||||
model_id?: string;
|
||||
}
|
||||
|
||||
export interface DeviceSelector {
|
||||
@ -721,6 +722,7 @@ export const filterSelectorDevices = (
|
||||
const {
|
||||
manufacturer: filterManufacturer,
|
||||
model: filterModel,
|
||||
model_id: filterModelId,
|
||||
integration: filterIntegration,
|
||||
} = filterDevice;
|
||||
|
||||
@ -732,6 +734,10 @@ export const filterSelectorDevices = (
|
||||
return false;
|
||||
}
|
||||
|
||||
if (filterModelId && device.model_id !== filterModelId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (filterIntegration && deviceIntegrationLookup) {
|
||||
if (!deviceIntegrationLookup?.[device.id]?.has(filterIntegration)) {
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user