Fix setup failure when BMS not immediately reachable
Don't connect eagerly in async_setup — let the first coordinator poll handle it. If the BMS is out of range at startup, UpdateFailed becomes ConfigEntryNotReady and HA retries automatically instead of crashing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -50,8 +50,7 @@ class BmsCoordinator(DataUpdateCoordinator[dict]):
|
|||||||
return device
|
return device
|
||||||
|
|
||||||
async def async_setup(self) -> None:
|
async def async_setup(self) -> None:
|
||||||
"""Connect to the BMS. Called once during config entry setup."""
|
"""No-op — connection is established lazily on the first poll."""
|
||||||
await self._handler.connect(self._get_ble_device())
|
|
||||||
|
|
||||||
async def async_teardown(self) -> None:
|
async def async_teardown(self) -> None:
|
||||||
"""Disconnect cleanly. Called on entry unload."""
|
"""Disconnect cleanly. Called on entry unload."""
|
||||||
|
|||||||
Reference in New Issue
Block a user