-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Add back Netatmo public weather sensors #34401
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.
Found a few things you could iterate over once more
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
if self.hass.config_entries.async_entries(DOMAIN): | ||
return self.async_abort(reason="already_setup") | ||
|
||
await self.async_set_unique_id(DOMAIN) |
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 don't we use the username or account 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.
Because it was never intended to support more than one account. But there is probably no reason not to if I can access that data.
device_registry.async_remove_device(device.id) | ||
|
||
if entities: | ||
async_add_entities(entities) |
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.
Can you end up adding certain areas twice?
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.
Not by name, but I am not checking if the selected area already exists. The same area can be added multiple times, which can make sense since it can return average or max values for the available stations.
Once options are comited and in another run the same name is entered it will edit the existing area by that name.
Although if the area is just created in that flow without being submitted it would be overwritten.
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.
I meant that could you end up passing certain entity objects twice to async_add_entities
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.
No, should not happen.
|
||
return self.async_show_form(step_id="public_weather", data_schema=data_schema) | ||
|
||
async def _update_options(self): |
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 helper method doesn't need to be a coroutine since we don't await inside.
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.
Actually we do in L105.
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.
There's no await inside this method. That's what matters. We of course need to await the method currently since we have defined it as a coroutine 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.
Oh, true. Fixed that in 5786afb
Thanks for pointing that out.
Breaking change
Proposed change
Add (back) the Netatmo public weather stations sensors and make them configurable from the UI.
Type of change
Example entry for
configuration.yaml
:# Example configuration.yaml
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: