hass-core/tests
J. Nick Koston b64ae55c66
Prebake common history queries (#37496)
* Prebake common history queries

The python overhead of to construct
the queries exceeded the database overhead.  We now
prebake the queries that get frequently polled.

This reduces the time it takes to update history_stats
sensors and can make quite a difference if there
are a lot of them.

When using the mini-graph-card card, all the entities
on the card being graphed are queried every few seconds
for new states. Previously this would tie up the database if there
are lot of these graphs in the UI.

* Update homeassistant/components/history/__init__.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/history/__init__.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* cache entity_filter in the lambda

* switch to yield

* Revert "switch to yield"

This reverts commit f8386f4940.

* get_states always returns a list

* query wasnt actually reusable so revert part of the breakout

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-07-05 11:03:23 -05:00
..
auth Use asynctest-mock in most places (#35109) 2020-05-03 11:27:19 -07:00
components Prebake common history queries (#37496) 2020-07-05 11:03:23 -05:00
fixtures Add ozw garage door barrier support (#37316) 2020-07-02 21:29:09 +02:00
hassfest
helpers Fix entity_component test flapping (#37445) 2020-07-04 16:55:44 +02:00
mock Use asynctest-mock in most places (#35109) 2020-05-03 11:27:19 -07:00
resources
scripts Use asynctest-mock in most places (#35109) 2020-05-03 11:27:19 -07:00
test_util Fix docstring in test_utils/aiohttp.py (#34040) 2020-04-11 20:20:19 +02:00
testing_config Address new issues flagged by flake8 3.8.0a2 (#34964) 2020-04-30 21:37:58 +02:00
util Fix cloudhooks coming in for non existing webhooks (#36836) 2020-06-15 16:30:40 -07:00
__init__.py
async_mock.py Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
bandit.yaml Enable some more bandit checks (#30857) 2020-01-20 18:44:55 +02:00
common.py Use eventloop for scheduling (#37184) 2020-06-29 09:39:24 -07:00
conftest.py Use eventloop for scheduling (#37184) 2020-06-29 09:39:24 -07:00
ignore_uncaught_exceptions.py Fix broken CI (#35314) 2020-05-06 18:40:21 -07:00
test_bootstrap.py Improve after_dependencies handling (#36898) 2020-06-19 17:24:33 -07:00
test_config.py Complete deprecation of hidden attribute (ATTR_HIDDEN) (#37041) 2020-06-23 17:05:32 -05:00
test_config_entries.py ConfigFlow default discovery without unique ID (#36754) 2020-06-15 13:38:38 +02:00
test_core.py Add concept of allowed external URLs to config (#36988) 2020-06-24 17:37:01 -07:00
test_data_entry_flow.py Add current step that is in progress (#35272) 2020-05-05 21:34:51 -07:00
test_loader.py Improve after_dependencies handling (#36898) 2020-06-19 17:24:33 -07:00
test_main.py Use asynctest-mock in most places (#35109) 2020-05-03 11:27:19 -07:00
test_requirements.py Upgrade zeroconf to 0.27.1 (#36277) 2020-06-05 14:33:26 -07:00
test_setup.py Improve after_dependencies handling (#36898) 2020-06-19 17:24:33 -07:00