-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
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
Fix Météo-France setup in non French cities (because of failed next rain sensor) #134782
base: dev
Are you sure you want to change the base?
Fix Météo-France setup in non French cities (because of failed next rain sensor) #134782
Conversation
Hey there @hacf-fr, @oncleben31, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Tested with following cities:
|
Pipe only fail because of coverage diff |
@@ -83,7 +84,13 @@ async def _async_update_data_alert() -> CurrentPhenomenons: | |||
update_method=_async_update_data_rain, | |||
update_interval=SCAN_INTERVAL_RAIN, | |||
) | |||
await coordinator_rain.async_config_entry_first_refresh() | |||
try: | |||
await coordinator_rain._async_refresh(log_failures=False) # noqa: SLF001 |
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.
why do we use _async_refresh
? And not a public function?
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.
As written in the description: to only warn but not raise an error.
Otherwise the user will both have an error and a warn.
Because async_refresh
log_failures=True !
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Proposed change
Test if the next rain is available for a configured location/city before adding it.
Only warn if no available, no error.
Type 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: