Skip to content

Commit

Permalink
add loading timer (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolivierarsenault authored Mar 26, 2024
1 parent 6a563e0 commit 7a56998
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/moonraker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
)

try:
await api.start()

async with async_timeout.timeout(TIMEOUT):
await api.start()
printer_info = await api.client.call_method("printer.info")
_LOGGER.debug(printer_info)

Expand All @@ -89,6 +90,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
hass.config_entries.async_update_entry(entry, title=api_device_name)

except Exception as exc:
_LOGGER.warning("Cannot configure moonraker instance")
raise ConfigEntryNotReady(f"Error connecting to {url}:{port}") from exc

coordinator = MoonrakerDataUpdateCoordinator(
Expand Down

0 comments on commit 7a56998

Please sign in to comment.