mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
20230601.0 (#16705)
* Fix fetching helper config entry (#16704) * Fix fetching helper config entry * willUpdate * Bumped version to 20230601.0 --------- Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
990ade4294
commit
9eb3618d97
@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "home-assistant-frontend"
|
||||
version = "20230531.0"
|
||||
version = "20230601.0"
|
||||
license = {text = "Apache-2.0"}
|
||||
description = "The Home Assistant frontend"
|
||||
readme = "README.md"
|
||||
|
@ -17,6 +17,7 @@ import {
|
||||
removeEntityRegistryEntry,
|
||||
updateEntityRegistryEntry,
|
||||
} from "../../../data/entity_registry";
|
||||
import { fetchIntegrationManifest } from "../../../data/integration";
|
||||
import {
|
||||
showAlertDialog,
|
||||
showConfirmationDialog,
|
||||
@ -46,12 +47,32 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) {
|
||||
@query("entity-registry-settings-editor")
|
||||
private _registryEditor?: EntityRegistrySettingsEditor;
|
||||
|
||||
protected firstUpdated(changedProps: PropertyValues): void {
|
||||
super.firstUpdated(changedProps);
|
||||
if (this.entry.config_entry_id) {
|
||||
getConfigEntry(this.hass, this.entry.config_entry_id).then((entry) => {
|
||||
this._helperConfigEntry = entry.config_entry;
|
||||
});
|
||||
protected willUpdate(changedProps: PropertyValues): void {
|
||||
super.willUpdate(changedProps);
|
||||
if (changedProps.has("entry")) {
|
||||
this._fetchHelperConfigEntry();
|
||||
}
|
||||
}
|
||||
|
||||
private async _fetchHelperConfigEntry() {
|
||||
if (!this.entry?.config_entry_id) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const configEntry = (
|
||||
await getConfigEntry(this.hass, this.entry.config_entry_id)
|
||||
).config_entry;
|
||||
const manifest = await fetchIntegrationManifest(
|
||||
this.hass,
|
||||
configEntry.domain
|
||||
);
|
||||
if (manifest.integration_type === "helper") {
|
||||
this._helperConfigEntry = configEntry;
|
||||
} else {
|
||||
this._helperConfigEntry = undefined;
|
||||
}
|
||||
} catch (err) {
|
||||
this._helperConfigEntry = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user