Commit Graph
117 Commits
Author SHA1 Message Date
J. Nick KostonandGitHub 00118a6f96 Speed up live history setup if there is no pending data to commit (#86942) 2023-01-30 19:00:34 +01:00
Franck NijhofandGitHub 62dcbe5258 Enable Ruff PT001 (#86730) 2023-01-26 18:05:05 +01:00
e50a531cd9 Code styling tweaks to the tests - Part 2 (#86662)
Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>
2023-01-26 01:23:53 +01:00
epenetandGitHub b4dd1b8cb2 Rename logbook constant (#86464) 2023-01-23 18:00:25 +02:00
Marc MuellerandGitHub d7dda6bee5 Update python version used for pylint [Py310] (#86414)
* Update python version used for pylint linting [Py310]

* Import Callable from collections.abc [Py310]

* Use builtin anext [Py310]
2023-01-23 07:56:15 +01:00
epenetandGitHub 30bf0634fe Add per-file-ignore to pylint (#86289) 2023-01-22 17:26:24 +01:00
J. Nick KostonandGitHub 5279535046 Fix live logbook stalling when there are no historical events with a high commit interval (#86110)
* Force live logbook to send an empty message to indicate no results

Since the sync task can take a while if the recorder is
busy, the logbook will appear to hang if we do not send
the first partial message even if its empty.

This work is in preparation for a higher database
commit interval where this issue is most obvious.

The historical only path did not have this issue because
it never had to wait for the db sync.

* update tests
2023-01-17 21:06:37 -05:00
J. Nick KostonandGitHub b8a1537b58 Improve performance of fetching and storing history and events with the database (#84870) 2023-01-02 13:26:08 -10:00
Marc MuellerandGitHub 63d519c1a8 Spelling updates (#82867) 2022-11-28 16:51:43 +01:00
J. Nick KostonandGitHub 43745dbc6c Pass explict time in logbook tests (#81725)
The CI sets the timezone to US/Pacific and the logbook
uses start_of_local_day when called without a time.

We now call the logbook api with a specific time to
avoid them being out of sync since the test would
fail at CET 8:55am on Mon Nov 7th 2022 (and probably
other dates)
2022-11-07 16:26:38 +01:00
J. Nick KostonandGitHub 11a55d6d4c Fix flapping logbook tests (#81695) 2022-11-07 11:41:02 +01:00
Erik MontnemeryandGitHub 31a787558f Ensure recorder test fixture is setup before hass fixture (#80528)
* Ensure recorder test fixture is setup before hass fixture

* Adjust more tests
2022-10-19 07:58:47 +02:00
Erik MontnemeryandGitHub e852c9b012 Fix logbook tests (#80264)
* Fix logbook tests

* Correct tests

* Improve tests
2022-10-13 17:34:45 +02:00
J. Nick KostonandGitHub 14611f9b5c Fix race in logbook websocket test (#78390) 2022-09-13 16:40:08 -04:00
fcb6888f87 Start logbook stream faster (#77921)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-09-09 17:16:02 -05:00
Martin HjelmareandGitHub c05905ebda Remove callback decorator from coroutine functions (#75626)
* Remove callback decorator from coroutine functions

* Remove some more callback decorators
2022-07-22 19:09:02 +02:00
J. Nick KostonandGitHub a8349a4866 Adjust entity filters to make includes stronger than excludes (#74080)
* Adjust entity filters to make includes stronger than excludes

Fixes #59080

* adjust test for stronger entity glob includes

* sync with docs
2022-06-28 11:42:51 -05:00
J. Nick KostonandGitHub 720768560d Fix devices missing in logbook when all requested entities are filtered (#74073) 2022-06-28 08:44:06 +02:00
J. Nick KostonandGitHub f29cc33fa0 Fix selecting entity_ids and device_ids in events with MySQL and PostgreSQL with logbook (#73918)
* Fix selecting entity_ids and device_ids in events with MySQL and PostgreSQL

Fixes #73818

* add cover
2022-06-24 15:43:35 +02:00
J. Nick KostonandGitHub e4f354998d Filter out forced updates in live logbook when the state has not changed (#73335) 2022-06-10 14:04:43 -07:00
J. Nick KostonandGitHub 0b62944148 Mark counter domain as continuous to exclude it from logbook (#73101) 2022-06-05 21:25:26 -10:00
J. Nick KostonandGitHub 457c7a4ddc Fix incompatiblity with live logbook and google_assistant (#73063) 2022-06-05 19:06:49 -10:00
J. Nick KostonandGitHub 6b2e5858b3 Send an empty logbook response when all requested entity_ids are filtered away (#73046) 2022-06-05 21:14:47 -07:00
J. Nick KostonandGitHub 5b31414225 Fix misalignments between sql based filtering with the entityfilter based filtering (#72936) 2022-06-02 20:52:53 -07:00
J. Nick KostonandGitHub c6e56c26b3 Fix logbook not setting up with an recorder filter that has empty fields (#72869) 2022-06-01 22:12:00 -07:00
J. Nick KostonandGitHub 5d2326386d Fix logbook spinner never disappearing when all entities are filtered (#72816) 2022-06-01 12:33:46 +02:00
J. Nick KostonandGitHub 35ee4ad55b Prevent live logbook from sending state changed events when we only want device ids (#72780) 2022-05-31 13:08:04 -07:00
J. Nick KostonandGitHub 587fd05603 Make logbook inherit the recorder filter (#72728) 2022-05-30 17:34:32 -07:00
a43d47fa0b Escape % and _ in history/logbook entity_globs, and use ? as _ (#72623)
Co-authored-by: pyos <pyos100500@gmail.com>
2022-05-27 14:38:29 -07:00
J. Nick KostonandGitHub bfa7693d18 Fixes for logbook filtering and add it to the live stream (#72501) 2022-05-25 15:17:08 -10:00
J. Nick KostonandGitHub 1c25e1d7b1 Add metadata to logbook live stream websocket endpoint (#72394) 2022-05-23 22:37:47 -07:00
J. Nick KostonandGitHub 9d95b9ab05 Chunk large logbook queries and add an end_time to the api so we stop sending events (#72351) 2022-05-23 15:40:00 -07:00
J. Nick KostonandGitHub 0248a8710f Always pass the source of the trigger for logbook context messages (#72333) 2022-05-23 13:35:45 -05:00
9c3f949165 Add live streaming logbook websocket endpoint (#72258)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-05-22 14:57:54 -05:00
J. Nick KostonandGitHub d459a5c66e Include context state in logbook responses to improve localization (#72222)
* Include context state in logbook responses to improve localization

* reduce payload, dont send context_event_type if sending context_state
2022-05-20 07:46:01 -07:00
J. Nick KostonandGitHub f06f94ea85 Add coverage to ensure we reject 0 length logbook filters (#72124) 2022-05-19 08:59:06 -07:00
J. Nick KostonandGitHub 272e65f56d Fix device_ids being filtered when entities also specified in the logbook (#72122) 2022-05-18 23:27:31 -05:00
c4fc84ec1e Add support for selecting device_ids from the logbook (#72039)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-05-18 01:58:30 -05:00
Paulus SchoutsenandGitHub 5433c0a535 Make sure empty get_events results is always a list (#72021) 2022-05-17 10:43:58 -07:00
J. Nick KostonandGitHub 089eb9960a Reduce logbook websocket payload size and parse json attributes via the DBM (#71895) 2022-05-15 20:48:57 -07:00
J. Nick KostonandGitHub 663f6f8340 Complete refactoring of logbook humanify (#71830) 2022-05-13 14:56:16 -07:00
J. Nick KostonandGitHub 2a2a7a62c5 Avoid matching entity_id/domain attributes in logbook when there is no entities_filter (#71825) 2022-05-13 13:16:33 -07:00
J. Nick KostonandGitHub 24a0007785 Add additional context data to logbook events (#71721) 2022-05-12 17:21:14 -07:00
04af9698d3 Add logbook/get_events websocket endpoint (#71706)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-05-11 22:28:06 -05:00
J. Nick KostonandGitHub 81e8d2ab86 Significantly improve logbook performance when selecting entities (#71657) 2022-05-11 15:27:02 -07:00
J. Nick KostonandGitHub 26177bd080 Convert logbook to use lambda_stmt (#71624) 2022-05-10 08:23:13 -05:00
J. Nick KostonandGitHub d8336a5216 Fix missing context_id in script logbook entries (#71602) 2022-05-09 15:22:27 -05:00
J. Nick KostonandGitHub 2560d35f1c Always show the start and stop event in logbook (#71600) 2022-05-09 15:21:21 -05:00
347193055e Rename logbook humanify function (#71597)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-05-09 23:10:26 +03:00
J. Nick KostonandGitHub 24d7a464e1 Refactor logbook to reduce overhead and complexity (#71509) 2022-05-08 21:47:26 -07:00