Commit Graph

84 Commits (56998f219b92281b0058ae6d0df6665759a73071)

Author SHA1 Message Date
J. Nick Koston 3150915cb7
Convert unindexed domain queries to entity_id queries (#68404) 2022-03-20 01:28:17 -10:00
J. Nick Koston 9215702388
Separate attrs into another table (reduces database size) (#68224) 2022-03-18 00:23:13 -10:00
J. Nick Koston bc862e97ed
Use a dedicated executor pool for database operations (#68105)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-03-17 23:09:01 -10:00
jan iversen 0d8ff3d724
Add codeowner to internal integrations that are without (#67286) 2022-02-28 09:06:16 +01:00
Paulus Schoutsen 1bbc1f5f55
Validate in split_entity_id (#66835) 2022-02-18 16:11:17 -08:00
epenet 946238fb02
Import frontend (#64104)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-14 10:01:12 +01:00
epenet e5ba34b9f9
Add init type hints [misc] (#63261)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-03 12:08:14 +01:00
epenet 8cc0df7b72
Ensure service calls are typed [k-n] (#62917)
* Ensure service calls are typed [k-n]

* Ensure service calls are typed in mazda

* Adjust mazda

* Add mazda comment

Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-28 14:33:08 +01:00
J. Nick Koston ccf8dcd14a
Fix Non-thread-safe operation in logbook (#62148) 2021-12-17 08:19:07 +01:00
Marc Mueller 84618fa831
Use assignment expressions 30 (#58714) 2021-10-30 16:33:42 +02:00
Marc Mueller eab235173b
Use assignment expressions 28 (#58189) 2021-10-22 14:06:04 +02:00
Marc Mueller 4f8148f9ea
Use assignment expressions 07 (#57787) 2021-10-17 20:24:34 +02:00
Marc Mueller aa7dc78a1e
Use assignment expressions 11 (#57792) 2021-10-17 20:15:48 +02:00
Ville Skyttä d8d34fdd3b
Prefer HTTPStatus over int in HA view JSON functions (#56504)
* Prefer HTTPStatus over int in HA view JSON functions

* Update zwave tests to not expect a fixed typo
2021-09-22 21:59:52 +03: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
Franck Nijhof c875ff8648
Store JSON in database in compact format (#53364)
* Store JSON in database in compact format

* Fix logbook
2021-07-22 12:05:59 -10:00
Ville Skyttä 470f2dd73f
Upgrade pyupgrade to 2.21.2, apply its changes (#52987) 2021-07-19 10:46:09 +02:00
tkdrob 028a07d86f
Wrap up selectors (#50794)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-05-25 14:45:17 +02:00
Marcin Ciupak caad125b44
Add support for Oracle DB in recorder (#50090) 2021-05-22 21:10:27 -05:00
tkdrob a9660d5788
Add targets and selectors for services (L-M) (#50543) 2021-05-15 11:06:34 +02:00
Paulus Schoutsen 4cf910affc
Guard logbook assuming entity ID is a string (#50047) 2021-05-04 14:23:22 -07:00
Martin Hjelmare 7e30ab2fb2
Add missing internal quality scale label (#48947)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-10 12:37:20 +02:00
Franck Nijhof 6932cf9534
Use contextlib.suppress where possible (#48189) 2021-03-23 14:36:43 +01:00
Paulus Schoutsen 04b335afe9
Allow filtering the logbook by context_id (#47783) 2021-03-12 09:04:02 -08:00
Franck Nijhof 3f96ebeae5
Add selectors to Logger, System Log & Logbook service definitions (#46740) 2021-02-18 16:33:29 +01:00
tkdrob d8a2e0e051
Remove unnecessary variables from logbook (#46350) 2021-02-10 12:17:37 -10: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 0e98bc5ea2
Skip template result parsing in several places (#42408)
* Skip template result parsing in several places

* Adjust alert integration

* Adjust Alexa integration

* Adjust apns integration

* Adjust arest integration

* Adjust dialogflow integration

* Adjust generic camera integration

* Adjust imap email content  integration

* Adjust InfluxDB integration

* Adjust intent integration

* Adjust logbook integration

* Adjust HP ILO integration

* Adjust manual alarm control panel integration

* Adjust manual mqtt alarm control panel integration

* Adjust minio integration

* Adjust mqtt integration

* Adjust notify integration

* Adjust persistent notification integration

* Adjust rest integration

* Adjust rss feed template integration

* Adjust slack integration

* Adjust Xiaomi integration

* Adjust TCP integration

* Adjust Telegram Bot integration

* Bump CI cache version

* Revert "Bump CI cache version"

This reverts commit 875efe58cf.

* Adjust demo tests
2020-10-26 19:29:10 +01:00
Philip Allgaier 625bbe6238
Cleanup unused loggers (components A-M) (#41600) 2020-10-12 16:59:05 +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 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 f6b0f8d6de
Update logbook to use async_add_executor_job (#38217) 2020-07-26 10:42:28 +02:00
J. Nick Koston 9db6318122
Remove support for legacy logbook events created before 0.112 (#37822)
* Remove support for legacy logbook events created before 0.112

Reduce the complexity of the logbook code.  This
should also have a small performance boost.

* None is the default
2020-07-15 10:38:08 -10:00
J. Nick Koston 4b2ebf5487
Ensure removed entities are not displayed in logbook (#37395) 2020-07-03 23:08:46 -07:00
J. Nick Koston 7e664fbb3b
Ensure logbook entries appear when the logbook.log (#37388)
service without a domain or entity_id
2020-07-02 19:53:28 -05:00
J. Nick Koston a87c29b5d9
Ensure logbook performs well when filtering is configured (#37292) 2020-07-02 09:12:27 -07:00
J. Nick Koston 76db2b39b0
Move logbook continuous domain filtering to sql (#37115)
* Move logbook continuous domain filtering to sql

sensors tend to generate a significant amount of states
that are filtered out by logbook.  In testing 75% of
states can be filtered away in sql to avoid the
sqlalchemy ORM overhead of creating objects that will
be discarded.

* remove un-needed nesting
2020-06-26 09:12:50 -05:00
Paulus Schoutsen 5bc6ed4cef
Add logbook platforms (#37078)
* Add logbook platforms

* Fix logbook describe test
2020-06-24 18:14:50 -07:00
mdegat01 6c7355785a
Add support for glob matching to entity filters (#36913)
* Added GLOB capability to entityfilter and every place that uses it. All existing tests are passing

* added tests for components affected by glob change

* fixed flake8 error

* mocking the correct listener

* mocking correct bus method in azure test

* tests passing in 3.7 and 3.8

* fixed formatting issue from rebase/conflict

* Checking against glob patterns in more performant way

* perf improvments and reverted unnecessarily adjusted tests

* added new benchmark test around filters

* no longer using get with default in entityfilter

* changed filter name and removed logbook from filter benchmark

* simplified benchmark tests from feedback

* fixed apache tests and returned include exclude schemas to normal

* fixed azure event hub tests to properly go through component logic

* fixed azure test and clean up for other tests

* renaming test files to match standard

* merged mqtt statestream test changes with base

* removed dependency on recorder filter schema from history

* fixed recorder tests after merge and a bunch of lint errors
2020-06-23 20:02:29 -05:00
J. Nick Koston 5b79c1f9ef
Remove support for deprecated hidden attribute from logbook and history (#37039) 2020-06-23 13:40:39 -07:00
J. Nick Koston 53a91ece4e
Improve isoformat timestamp performance (#36991)
* adj

* time_fired_isoformat

* remove unused code

* tests for processing timestamps

* restore missing import lost in merge conflict

* test for None case
2020-06-22 12:06:02 -05:00
J. Nick Koston 1de97e3a35
Fix logbook filtering by entity id (#36973)
* Fix logbook filtering by entity_id

* remove debug
2020-06-21 14:34:47 -05:00
J. Nick Koston 59e43ab6e4
Prefilter more logbook events in sql (#36958)
* Prefilter more logbook events in sql

Prefilter sensor events in _keep_event before humanify

Cache static attribute lookup

Reduces logbook execution time by ~35%

* fix mocking in benchmark

* Update tests for logbook users
2020-06-21 10:50:58 -07:00
J. Nick Koston e7d982ee11
Improve db performance of state change events and reduce overall db size (#36883)
* Add old_state_id to states, remove old/new state data from events since it can now be found by a join

* remove state lookup on restart

* Ensure old_state is set for exisitng states
2020-06-17 22:26:41 -05:00