-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Add SensorEntityClass support for Environment Canada integration #58615
Conversation
Hey there @michaeldavie, mind taking a look at this pull request as it has been labeled with an integration ( |
Is this type of sensor allowed now? There was a discussion of this in #37415 (comment) where a |
I have to admit I don't find that the solution in the PR isn't the best, but it is the best that a can see right now. I'm not sure firing events is what users want. Storing the alerts in the extra state attributes makes them always available. As @cgarwood says in his comment in the PR you reference: HA doesn't really have a good system for weather alerts. I don't know of anything that's changed, so I'm proposing that we listen to options and if nothing compelling go ahead as is. If HA comes up with a better solution as some point I'd be happy to help implement and fix up this integration. Last bit.. in the referenced PR it seems part of the discomfort is that events and state change were being done and it was asked to pick one of the two. This PR has only state change. |
I mainly raised this issue so that I can also get clarity for implementing something similar for NWS integration. The sensor only approach has a lot of downsides from a user experience perspective. A new entity type for these kind of alerts would be preferred IMO. |
I've tested this branch locally and it's working well. I like the addition of the observation time sensor. |
Any chance someone could take a look at this one? Thx! |
Would it be possible for someone to take a look at this? |
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.
Thanks, @gwww 👍
No, thank you! If there are some boil plate changes that need to be made, I'd be happy to pick one up. I don't know where to look though. |
Breaking change
Timestamp
as an extra state attribute. Use the newtimestamp
sensor that can be used in automations that track state changes.advisories
,endings
,statements
,warnings
, andwatches
) state is now a count of the number of active alerts for the sensor type and the extra state attributes contain the alert text and alert timestamp. The attributes are namedalert_<x>
andalert_time_<x>
where is 1 for alert 1, 2 for alert 2, etc.Proposed change
Add SensorEntityClass support for Environment Canada integration. This PR also addresses a comment by @MartinHjelmare on the previous Environment Canada PR (#57746).
Type of change
Additional information
This PR is a follow on to #57746.
With the intent of keeping this PRs small as possible, there will be at least one more PR with some additional cleanup and adding another sensor that requires another Coordinator.
No document updates required for this PR.
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: