Add WS command for getting a config entry (#16600)

* Add WS command for getting a config entry

* Correct typing
This commit is contained in:
Erik Montnemery 2023-05-23 10:43:53 +02:00 committed by GitHub
parent 847c8407de
commit 5a36f100a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,11 +89,17 @@ export const getConfigEntries = (
}
}
return hass.callWS<ConfigEntry[]>({
type: "config_entries/get",
type: "config_entries/get_matching",
...params,
});
};
export const getConfigEntry = (hass: HomeAssistant, configEntryId: string) =>
hass.callWS<{ config_entry: ConfigEntry }>({
type: "config_entries/get",
entry_id: configEntryId,
});
export const updateConfigEntry = (
hass: HomeAssistant,
configEntryId: string,