Separate status and location check try/catches

This commit is contained in:
Jack Boswell (boswelja) 2023-08-19 15:28:18 +12:00
parent 730129d4e5
commit 7628ec62f6

View file

@ -56,13 +56,18 @@ class StarlinkUpdateCoordinator(DataUpdateCoordinator[StarlinkData]):
status = await self.hass.async_add_executor_job(
status_data, self.channel_context
)
except GrpcError as exc:
raise UpdateFailed from exc
try:
location = await self.hass.async_add_executor_job(
location_data, self.channel_context
)
return StarlinkData(location, *status)
except GrpcError as exc:
raise UpdateFailed from exc
return StarlinkData(location, *status)
async def async_stow_starlink(self, stow: bool) -> None:
"""Set whether Starlink system tied to this coordinator should be stowed."""
async with asyncio.timeout(4):