-
Notifications
You must be signed in to change notification settings - Fork 93
Fix: Added fix for rate_limit_delay attribute error, resolved async wait #218
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
base: master
Are you sure you want to change the base?
Conversation
| for component in PLATFORMS: | ||
| await hass.config_entries.async_forward_entry_setup(entry, component) | ||
| # Resolve deprecation in latest HA by moving to setups vs setup | ||
| await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) |
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 catch!
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.
#235 is more thorough with the addition of error logging on fail
| success = False | ||
| try: | ||
| success = hass.config_entries.async_forward_entry_unload(entry, component) | ||
| success = await hass.config_entries.async_forward_entry_unload(entry, component) |
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 will fail, the function needs to be defined as async
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 tried the changes manually and they seem to work but this PR making the line 96 function definition async.
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.
@gabosom odd, I could have sworn I tried that and still got errors. So did you set the def as a sync and keep the await?
I can give that another test and update the PR
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.
When the await is added
success = await hass.config_entries.async_forward_entry_unload(entry, component)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: 'await' outside async function
After changing to async def _unload_component_entry the error goes away but 2 new errors appear
Error unloading entry govee for light
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 963, in async_unload
result = await component.async_unload_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 703, in async_unload_entry
return await hass.data[DATA_COMPONENT].async_unload_entry(entry)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 237, in async_unload_entry
raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
and
Error setting up entry govee for govee
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 749, in __async_setup_with_context
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/govee/__init__.py", line 69, in async_setup_entry
raise PlatformNotReady()
homeassistant.exceptions.PlatformNotReady: None
But I think they are caused by me currently being rate-limited.
This should resolve the errors with the
rate_limit_delayfunction, as well as subsequent async related errors that happen afterwards.Resolves: #216