Commit cf3909e
Fix websocket reconnecting after intentional stop
When Home Assistant shuts down, the websocket stop() method sets state to
STOPPED, but the running() coroutine's else block unconditionally calls
retry(), causing an unwanted reconnection attempt. Add a _closing flag to
distinguish intentional stops from unexpected disconnections, so only the
latter trigger automatic reconnection.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent dff7c84 commit cf3909e
1 file changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
175 | | - | |
176 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
177 | 181 | | |
178 | 182 | | |
179 | 183 | | |
180 | 184 | | |
| 185 | + | |
181 | 186 | | |
182 | 187 | | |
183 | 188 | | |
| |||
0 commit comments