-
Notifications
You must be signed in to change notification settings - Fork 580
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
Document CheckResult#previous_hard_state #9737
base: master
Are you sure you want to change the base?
Conversation
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.
Would be great to briefly explain (if any) the difference to Service#last_hard_state
there as well. I think there's already quite a lot of confusion with all the (macro) runtime attributes and that doesn't make it any easier.
25c5af2
to
51d5286
Compare
I'm decoupling this from #9723 as this PR doesn't really fix anything in that regard, it just adds some documentation for a missing attribute. That issue claims that there is some discrepancy between the documentation and the implementation in regard to some state attribute (integer vs. string representation). Either that claim is correct, then this PR doesn't fix it or the claim is incorrect but instead probably the result of some confusion between object attributes and macros, then this PR doesn't fix it either and instead, we should check if this is properly documented or could be documented more clearly. |
Originally, these macros were available containing state information:
Since #9171, there now additionally is:
Which feels very out of place and was primarily added there due to some details of how notifications might be sent in HA zones (#9132 has some more details about that). Now my first intuition would be to document it as such, i.e. some internal attribute, similar to how So wouldn't it make more sense to add a corresponding macro to host/service, document it properly next to the other ones including how they interact (i.e. what is "last" and "previous" supposed to mean and so on) and document the one in the check result as "used internally, use that other one instead"? Retrospectively, I'd say the one in check result shouldn't have been user-visible in the first place, but now it's there and we're probably stuck with it. |
Please not yet another macro for the same thing! We're so close to finishing the milestone.. |
Having
I certainly don't want to rush any changes, all these state attributes/macros are already messy enough and any quick change might just make it worse in the end. So if we change something there, we should have a general concept (see also what I wrote in #9723 (comment)). The question is: what's the best option for in the meantime?
I think some kind of documentation would primarily benefit users that find it by chance, either by looking at the check result docs or by noticing the attribute in some API response. I don't think someone would actually find it from the list of checkable attributes/macros (as I really wouldn't expect older information in the current check result, that's why I think this is attribute in the wrong place (when exposed to the user, for internal use, there are some reasons for that)). |
Let’s do this and later make a plan. |
Removed this PR from the milestone, so you might want to adjust #9760 accordingly. |
No description provided.