fix: Prevent premature reinitialization when stale HA reconnects (#2717)

- Closes: #2714
This commit is contained in:
Dermot Duffy
2026-08-29 13:47:38 -07:00
committed by GitHub
parent fb53681978
commit 4b101545cc
15 changed files with 333 additions and 131 deletions
+8
View File
@@ -210,6 +210,14 @@ export class FakeHASS {
*/
public setConnected(connected: boolean): void {
this._connected = connected;
// The real frontend keeps the pre-disconnect `hass.config` until its own
// `get_config` resolves after the socket returns. Mint a fresh object
// here to models that behavior.
if (connected) {
this._config = createConfig(this._config.state);
}
this._renew();
}