Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions homeassistant/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import logging.handlers
import os
from timeit import default_timer as timer

from types import ModuleType
from typing import Optional, Dict
Expand Down Expand Up @@ -175,6 +176,7 @@ def log_error(msg, link=True):

async_comp = hasattr(component, 'async_setup')

start = timer()
_LOGGER.info("Setting up %s", domain)
warn_task = hass.loop.call_later(
SLOW_SETUP_WARNING, _LOGGER.warning,
Expand All @@ -191,7 +193,9 @@ def log_error(msg, link=True):
async_notify_setup_error(hass, domain, True)
return False
finally:
end = timer()
warn_task.cancel()
_LOGGER.info("Setup of domain %s took %.1f seconds.", domain, end - start)

if result is False:
log_error("Component failed to initialize.")
Expand Down