-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Add days of validity as an attribute to 8000 cert_expiry #51524
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
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.
LGTM
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.
...and we come full circle with this one 😉
Looks good!
Why is this an attribute and not a separate sensor? |
With a previous PR we removed relative time sensor as it should not be allowed anymore. Am I wrong ? Simone |
This brings back the old issue (only hidden in the attribute). I'm ok with adding these types of sensors, when separated and disabled by default As a general rule of thumb, if you want to make automations based on a state attrib 8000 ute, is should have been an entity. |
Got it, so why we removed it in #42338 ? ;-) Simone |
As for the main sensor provided, the changed behavior in #42338 is correct. Some helper entities are OK IMHO (for example, we do this a lot for e.g., weather platforms). However, I think it would be nicer if we could make the use of dates in automation easier. Whatever the case, if this is there to make automation easier, it would be a workaround. How can we make this easier in automation? Could you provide an example of an automation that is unneeded hard now? |
I would say a timedelta like function would make templating super easy. So to get minutes/hours/days/months between two timestamps.
Binary_sensor for remaining days < X days, to be used in alert. |
time delta's is already provided. Playing with it myself just now, I guess we don't provide an easy way to parse timestamps. |
Got another solution, writing tests as we speak and will open a PR. |
With the PR in #51576 it can be done like this: Is that an acceptable solution? |
Really nice one! |
Proposed change
Add a new attribute, Days of validity, to allow easy handling in automations
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: