mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-24 21:37:21 +00:00
Use websocket endpoint to fetch config entries (#12964)
This commit is contained in:
parent
05346ae9fc
commit
3633daa814
@ -38,19 +38,19 @@ export const getConfigEntries = (
|
||||
hass: HomeAssistant,
|
||||
filters?: { type?: "helper" | "integration"; domain?: string }
|
||||
): Promise<ConfigEntry[]> => {
|
||||
const params = new URLSearchParams();
|
||||
const params: any = {};
|
||||
if (filters) {
|
||||
if (filters.type) {
|
||||
params.append("type", filters.type);
|
||||
params.type_filter = filters.type;
|
||||
}
|
||||
if (filters.domain) {
|
||||
params.append("domain", filters.domain);
|
||||
params.domain = filters.domain;
|
||||
}
|
||||
}
|
||||
return hass.callApi<ConfigEntry[]>(
|
||||
"GET",
|
||||
`config/config_entries/entry?${params.toString()}`
|
||||
);
|
||||
return hass.callWS<ConfigEntry[]>({
|
||||
type: "config_entries/get",
|
||||
...params,
|
||||
});
|
||||
};
|
||||
|
||||
export const updateConfigEntry = (
|
||||
|
Loading…
x
Reference in New Issue
Block a user