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
|
||||
|
||||
async def async_setup(self) -> None:
|
||||
"""Connect to the BMS. Called once during config entry setup."""
|
||||
await self._handler.connect(self._get_ble_device())
|
||||
"""No-op — connection is established lazily on the first poll."""
|
||||
|
||||
async def async_teardown(self) -> None:
|
||||
"""Disconnect cleanly. Called on entry unload."""
|
||||
|
||||
Reference in New Issue
Block a user