-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,12 +64,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): | |
| _, err = await hub.get_devices() | ||
| if err: | ||
| _LOGGER.warning("Could not connect to Govee API: %s", err) | ||
| await hub.rate_limit_delay() | ||
| await hub._api.rate_limit_delay() | ||
| await async_unload_entry(hass, entry) | ||
| raise PlatformNotReady() | ||
|
|
||
| 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) | ||
|
|
||
| return True | ||
|
|
||
|
|
@@ -99,7 +99,7 @@ def _unload_component_entry( | |
| """Unload an entry for a specific component.""" | ||
| 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 commentThe 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 commentThe 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.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. When the await is added After changing to and But I think they are caused by me currently being rate-limited. |
||
| except ValueError: | ||
| # probably ValueError: Config entry was never loaded! | ||
| return success | ||
|
|
||
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