J. Nick Koston
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
Erik Montnemery
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
J. Nick Koston
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 Koston
0b62944148
Mark counter domain as continuous to exclude it from logbook ( #73101 )
2022-06-05 21:25:26 -10:00
J. Nick Koston
5b31414225
Fix misalignments between sql based filtering with the entityfilter based filtering ( #72936 )
2022-06-02 20:52:53 -07:00
J. Nick Koston
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 Koston
bfa7693d18
Fixes for logbook filtering and add it to the live stream ( #72501 )
2022-05-25 15:17:08 -10:00
J. Nick Koston
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 Koston
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 Koston
f06f94ea85
Add coverage to ensure we reject 0 length logbook filters ( #72124 )
2022-05-19 08:59:06 -07:00
J. Nick Koston
272e65f56d
Fix device_ids being filtered when entities also specified in the logbook ( #72122 )
2022-05-18 23:27:31 -05:00
J. Nick Koston
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 Schoutsen
5433c0a535
Make sure empty get_events results is always a list ( #72021 )
2022-05-17 10:43:58 -07:00
J. Nick Koston
089eb9960a
Reduce logbook websocket payload size and parse json attributes via the DBM ( #71895 )
2022-05-15 20:48:57 -07:00
J. Nick Koston
663f6f8340
Complete refactoring of logbook humanify ( #71830 )
2022-05-13 14:56:16 -07:00
J. Nick Koston
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 Koston
24a0007785
Add additional context data to logbook events ( #71721 )
2022-05-12 17:21:14 -07:00
J. Nick Koston
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 Koston
81e8d2ab86
Significantly improve logbook performance when selecting entities ( #71657 )
2022-05-11 15:27:02 -07:00
J. Nick Koston
26177bd080
Convert logbook to use lambda_stmt ( #71624 )
2022-05-10 08:23:13 -05:00
J. Nick Koston
d8336a5216
Fix missing context_id in script logbook entries ( #71602 )
2022-05-09 15:22:27 -05:00
J. Nick Koston
2560d35f1c
Always show the start and stop event in logbook ( #71600 )
2022-05-09 15:21:21 -05:00
J. Nick Koston
24d7a464e1
Refactor logbook to reduce overhead and complexity ( #71509 )
2022-05-08 21:47:26 -07:00
Erik Montnemery
203bebe668
Include all non-numeric sensor events in logbook ( #71331 )
2022-05-05 13:16:36 -04:00
J. Nick Koston
b8442d9340
Add json decode caching to logbook ( #71080 )
2022-05-01 19:33:31 -05:00
Erik Montnemery
3016b5fbfc
Use recorder fixtures and helpers in tests ( #70773 )
2022-04-26 06:08:00 -10:00
Marc Mueller
9b9b553521
Disable no-self-use [pylint] ( #70641 )
...
* Disable no-self-use
* Remove disable comments
2022-04-25 07:41:01 -07:00
Erik Montnemery
28ebab9c5a
Simplify waiting for recorder in tests ( #70647 )
2022-04-25 12:04:47 +02:00
Erik Montnemery
982e314de6
Use recorder_mock in tests ( #70363 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-04-22 19:29:44 -10:00
J. Nick Koston
4f9df1fd0f
Fix logbook tests ( #68443 )
2022-03-20 20:34:02 -07:00
J. Nick Koston
9215702388
Separate attrs into another table (reduces database size) ( #68224 )
2022-03-18 00:23:13 -10:00
Paulus Schoutsen
08083f399e
Convert some tests to async and drop usage get_test_home_assistant ( #64394 )
...
* Fix some tests
* Update MS tests
* Convert last logbook tests to async
2022-01-18 19:37:17 -08:00
Ville Skyttä
ce1eda9809
Use http.HTTPStatus in components/[ikl]* ( #58248 )
2021-10-22 23:06:18 +02:00
Tatham Oddie
4fa9871080
Fix logbook entity_matches_only query mode ( #55761 )
...
The string matching template needs to match the same compact JSON format
as the data is now written in.
2021-09-06 13:39:39 -07:00
Paulus Schoutsen
04b335afe9
Allow filtering the logbook by context_id ( #47783 )
2021-03-12 09:04:02 -08:00
Michael Chisholm
e35e460e69
Use parent_id to find cause of logbook events with new contexts ( #44416 )
...
* Use parent_id to find cause of events with new contexts
When looking up the causing event for logbook display, use the `parent_id`
of the current context if the current context just points back to the
current event.
This now shows in the logbook the cause of an event in the case that a
component has created a new context from an existing context and tied
them together via the `Context.parent_id`.
* Fix exception when parent event not available
* Use async_Log_entry to avoid jump into executor
2021-01-07 20:27:03 -10:00
Franck Nijhof
65cf2fcb6f
Drop asynctest ( #44746 )
2021-01-01 22:31:56 +01:00
taiyeoguns
8f74a0c2e6
Convert logbook tests to pytest ( #42289 )
2020-10-26 09:18:02 +01:00
Philip Allgaier
dde6305549
Cleanup unused loggers (components N-Z + tests) ( #41982 )
2020-10-16 21:24:08 -05:00
J. Nick Koston
49e5b665cf
Convert final async_add_job to async_add_executor_job in logbook tests ( #41552 )
2020-10-09 15:52:06 +02:00
J. Nick Koston
2076fc59c4
Remove message and domain from logbook state_changed events ( #40070 )
...
These are now handled by the frontend as we move closer
to making the logbook localized.
2020-09-30 11:29:51 -05:00
J. Nick Koston
d9ba32dc3f
Setup recorder model relationships to avoid calling flush ( #40467 )
2020-09-30 13:11:43 +02:00
J. Nick Koston
aada6a1d88
Fix logbook with empty filter and remove unused code ( #40565 )
2020-09-30 13:10:11 +02:00
J. Nick Koston
a19e10c57a
Add entity glob matching support to history ( #40387 )
2020-09-28 15:58:55 +02:00
J. Nick Koston
7029345b9d
Add support for selecting multiple entity ids from logbook ( #40075 )
2020-09-22 09:27:04 -05:00
J. Nick Koston
15281f468e
Extract the icon and state for logbook state changed events ( #40039 )
2020-09-14 09:35:19 -05:00
J. Nick Koston
45c28dd9c5
Provide a logbook option entity_matches_only to optimize for single entity lookup ( #39555 )
...
* Provide a logbook option entity_matches_only to optimize for single entity id lookup
When entity_matches_only is provided, contexts and events that do not
contain the entity_id are not included in the logbook response.
* Update homeassistant/components/logbook/__init__.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* api only takes a single entity
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-09-02 10:32:08 -05:00
J. Nick Koston
dda4cf4d58
Tune logbook performance to accomodate recent changes ( #39348 )
2020-08-30 09:20:31 +02:00
J. Nick Koston
6b7a7939d2
Include the first seen context data in the logbook api ( #39194 )
...
* Include the context_entity_id in the logbook api
context_entity_id is the first entity seen during
a time period that includes the context
* update test
* more of them
* include friendly name
* pylint wants a ternary
* Refactor
* performance
* fix homekit context
* Fix self describing events
* Fix external_events
2020-08-24 12:44:40 -05:00
J. Nick Koston
f5b628c04f
Cleanup logbook tests to prevent failure on race condition ( #37928 )
2020-07-16 21:48:22 -07:00