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
Use skip_configuration flag to skip requests in ZHA #41554
Use skip_configuration flag to skip requests in ZHA #41554
Conversation
The on_off attribute is on the REPORT_CONFIG, so super().async_initialize already requests it from the device. No need to request it twice.
Still have to fix imports order. |
77f9e5e
to
3df604e
Compare
…into zha_faster_init_skipconfig
@Adminiuga @dmulcahey Can you take a look please? |
if self._ch_pool.skip_configuration: | ||
self._status = ChannelStatus.INITIALIZED | ||
return | ||
|
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'm wondering if this is going to affect restoration of Xiaomi based sensors values after a restart???
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.
You are right. Maybe I should do
if not from_cache and self._ch_pool.skip_configuration:
What do you think?
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.
That should work.
) | ||
if power_source is not None: | ||
self._power_source = power_source | ||
if not self._ch_pool.skip_configuration: |
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.
same as above
…into zha_faster_init_skipconfig
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.
lgtm
Proposed change
Some initialization requests were still being made, despite skip_configuration being set for the device. Since devices that have this set to True don't usually reply without being constantly waked up, we can skip some requests to make pairing quicker.
Note: we could add a skip_initialization flag, but I don't think that's really needed atm.
Type of change
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: