-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
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
Remove hourly weather entity from NWS #112503
Conversation
Hey there @MatthewFlamm, @kamiyo, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
# Add hourly entity to legacy config entries | ||
if entity_registry.async_get_entity_id( | ||
# Remove hourly entity from legacy config entries | ||
if entity_id := entity_registry.async_get_entity_id( |
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.
At some point we can assume that users will no longer have this entity. Should we aim to remove this code at some point, and add a comment to this effect? Or are we committing to keeping this around?
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.
6 releases is the general deprecation time so I guess that's relevant here too for cleaning this up eventually.
The Unfortunately if we expand to check all coordinators last success to check for availability, this combined hourly and twice daily forecast structure will make it even more likely for this entity to show unavailable. |
I don't know how many days the forecasts are usually, but can we cache the results and only return |
The way it works currently is similar but slightly different. If the last success time was within some time period from now then it is considered available, otherwise unavailable. This PR keeps this, but we now only have one entity with two forecast coordinators. Only one forecast coordinator is used to determine availability. I worry that including both will cause extra 'unavailable' times for users who just want one forecast. The NWS servers are flaky enough that this is a problem. But not including them all will result in potentially more stale forecasts to be shown. |
Changing the behavior of the |
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.
This generally LGTM. However, I think it would be good to have feedback on how much time must elapse before we can assume users no longer have the hourly entity to clean up the code.
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, @gjohansson-ST 👍
../Frenck
Breaking change
The
nws
integration previously created two entities for each configured location, one entity which provided daily weather forecasts and one entity which provided hourly forecasts. Thenws
integration now only creates a single entity which provides both daily and hourly weather forecasts.Proposed change
Remove the hourly weather entity from
nws
and instead provide hourly + daily forecasts in one entityType 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
..coveragerc
.To help with the load of incoming pull requests: