Going async with denonavr#47920
Conversation
|
Hey there @starkillerOG, mind taking a look at this pull request as its been labeled with an integration ( |
|
CI should pass if you rebase |
The config flow tests are broken because they are using internal variables which changed. I'm fixing that, but my local tox run is taking ages. |
|
Please @bdraco when you are ready for a review |
|
@bdraco ready for review 😄 I changed my initial posting accordingly |
bdraco
left a comment
There was a problem hiding this comment.
Nice! Please see comments above
Thanks 😄 |
|
@bdraco finally found the memory leak. It was related to an lru cache, which is cleared now on exceptions. I just did a rebase too. |
|
btw. it could take a while until garbage collector found the instances from the cleared cache. Thus, object count might go up and down |
|
Thanks. I'll do testing later tonight |
|
The change to include the exception cause when raise Suggested change (should cherry-pick cleanly) bdraco@c94efca
The great part here is it will automatically take care of downgrading retries to debug with a lot less code to maintain. |
|
Leak confirmed fixed |
|
@bdraco cherry picking worked and so did the other changes |
Handling in Config Flow needed to be adapted slightly because it cannot handle |
Looks like there are no tests for |
….py to .coveragerc
|
@bdraco ok, fixed and all tests have passed 😄 |
MartinHjelmare
left a comment
There was a problem hiding this comment.
Please address the comments in a new PR. Thanks!
| "manufacturer": self._config_entry.data[CONF_MANUFACTURER], | ||
| "name": self._config_entry.title, | ||
| "model": f"{self._config_entry.data[CONF_MODEL]}-{self._config_entry.data[CONF_TYPE]}", | ||
| "serial_number": self._config_entry.data[CONF_SERIAL_NUMBER], |
There was a problem hiding this comment.
Serial number is not part of device info api:
https://developers.home-assistant.io/docs/device_registry_index#device-properties
| self._host = host | ||
| self._show_all_inputs = show_all_inputs | ||
| self._timeout = timeout | ||
| self._entry_state = entry_state |
There was a problem hiding this comment.
The entry state attribute is never used.
Proposed change
With this update
denonavris going async. It is using httpx instead of requests now and is 100% async.There are a few bugs which are already identified and fixed in dev version of denonavr or in progress:- non functional play-pause toggle- improvement of 403 error handling of AVR-X 2016 receiversI would like to collect some fixes and add fixes for potential issues discovered here during review.That's why I did not set the "local tests pass" flag yet. Please start reviewing the changes anyhow. There is a bunch of them.Known bugs are fixed, ready to proceed.
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: