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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update risco to use CoordinatorEntity #39456
Conversation
@@ -29,17 +15,10 @@ def _refresh_from_coordinator(self): | |||
async def async_added_to_hass(self): | |||
"""When entity is added to hass.""" | |||
self.async_on_remove( | |||
self._coordinator.async_add_listener(self._refresh_from_coordinator) | |||
self.coordinator.async_add_listener(self._refresh_from_coordinator) |
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.
won't this result in two calls to async_write_ha_state()
(one directly from CoordinatorEntity
and the other from RiscoEntity._refresh_from_coordinator()
)?
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 if super isnt called in risco method
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.
Good call!
I tested this locally - it's working well. |
Proposed change
Update risco to use CoordinatorEntity
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:
To help with the load of incoming pull requests: