-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify recorder RecorderRunsManager #131785
Conversation
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
@property | ||
def first(self) -> RecorderRuns: | ||
"""Get the first run.""" | ||
if runs_by_timestamp := self._run_history.runs_by_timestamp: | ||
return next(iter(runs_by_timestamp.values())) | ||
return self.current | ||
return self._first_run or self.current |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first
property is used for system health. Considering we're no longer relying on the recorder runs to avoid unnecessary history queries, but instead the timestamp of the oldest state, we should perhaps remove this property and include the timestamp of the oldest state in the system health information instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a good change to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll do that in a follow-up 👍
Tagged for 2024.12.4 to avoid merge conflicts when including revert of PR #131702 in the milestone |
Proposed change
Simplify recorder
RecorderRunsManager
With merge of PR #131702, we no longer need to keep all the rows in the
RecorderRuns
table in memoryType of change
Additional information
Checklist
ruff format 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
.To help with the load of incoming pull requests: