Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precompute logbook excluded events #21587

wants to merge 1 commit into
base: dev


None yet
4 participants
Copy link

amelchio commented Mar 2, 2019


A proposal for reducing the logbook load time by computing the exclude flag when the event is written (I realize that there are still some details missing).

@balloob @OverloadUT I wanted to get your opinion on this approach before spending more time on it. I am not yet sure what I think about it myself.

Related issue (if applicable): fixes #

Pull request in with documentation (if applicable): home-assistant/< PR number goes here>


  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
dbevent = Events.from_event(event)
for_logbook = logbook.keep_event(dbevent.to_native())

This comment has been minimized.


houndci-bot Mar 2, 2019

line too long (81 > 79 characters)


This comment has been minimized.

Copy link
Member Author

amelchio commented Mar 2, 2019

I decided that I don't like this. I think a more radical change is needed, this one has too many problems for too little benefit.

@amelchio amelchio closed this Mar 2, 2019

@wafflebot wafflebot bot removed the in progress label Mar 2, 2019


This comment has been minimized.

Copy link

balloob commented Mar 3, 2019

For truly radicalism, home-assistant/architecture#110 proposes to compute the logbook line at the time of the event, and so the reader will just fetch lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.