Include all non-numeric sensor events in logbook#71331
Conversation
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( |
| """Generate a converted list of events into Entry objects. | ||
|
|
||
| Will try to group events if possible: | ||
| - if 2+ sensor updates in GROUP_BY_MINUTES, show last |
There was a problem hiding this comment.
The SQL query generated by _get_events already filters out all entities from the sensor and proximity domains which have a unit of measurement; hence the grouping here filled no purpose and is removed in this PR.
| entries = await _async_fetch_logbook(client) | ||
|
|
||
| assert len(entries) == 3 | ||
| assert len(entries) == 4 |
There was a problem hiding this comment.
As an alternative to changing this, we could set a unit on the state.
| entries = await _async_fetch_logbook(client) | ||
|
|
||
| assert len(entries) == 3 | ||
| assert len(entries) == 4 |
There was a problem hiding this comment.
As an alternative to changing this, we could set a unit on the state.
| assert len(calls) == 0 | ||
|
|
||
|
|
||
| def test_humanify_filter_sensor(hass_): |
There was a problem hiding this comment.
This was not a good test, humanify should not be tested on its own.
In a follow-up we should rename humanify to _humanify to make it clear it's not to be used on its own.
|
I’ll profile and test this tomorrow when I get back home |
|
I did a profile with Using some test data I had with MANY sensor updates. The new code looks good. The bottleneck for non-sqlalchemy code was |
|
Something like this removes the |
|
FTR: #71345 adds an LRU-cache to |
Proposed change
Include all non-numeric sensor events in logbook
This PR makes the following changes:
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: