Fix stuck onboarding when no devices are discovered (#25106)

* Broken onboarding

* Introduce a boolean var and return previous code

* Remove import
This commit is contained in:
Simon Lamon 2025-04-23 07:14:03 +02:00 committed by GitHub
parent fcab356639
commit 48c90267df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,7 +35,9 @@ class OnboardingIntegrations extends SubscribeMixin(LitElement) {
@state() private _entries: ConfigEntry[] = []; @state() private _entries: ConfigEntry[] = [];
@state() private _discoveredDomains = new Set<string>(); @state() private _discoveredDomains: Set<string> = new Set<string>();
@state() private _discoveredDomainsReceived = false;
public hassSubscribe(): (UnsubscribeFunc | Promise<UnsubscribeFunc>)[] { public hassSubscribe(): (UnsubscribeFunc | Promise<UnsubscribeFunc>)[] {
return [ return [
@ -53,6 +55,7 @@ class OnboardingIntegrations extends SubscribeMixin(LitElement) {
"title", "title",
Array.from(this._discoveredDomains) Array.from(this._discoveredDomains)
); );
this._discoveredDomainsReceived = true;
}), }),
subscribeConfigEntries( subscribeConfigEntries(
this.hass, this.hass,
@ -97,7 +100,7 @@ class OnboardingIntegrations extends SubscribeMixin(LitElement) {
} }
protected render() { protected render() {
if (!this._discoveredDomains.size) { if (!this._discoveredDomainsReceived) {
return nothing; return nothing;
} }
// Render discovered and existing entries together sorted by localized title. // Render discovered and existing entries together sorted by localized title.