fix: Prevent premature reinitialization when stale HA reconnects (#2717)
- Closes: #2714
This commit is contained in:
1 parent
fb53681978
commit
4b101545cc
15 files changed
+333
-131
No files matched your search
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user