Fix TypeError in switch.py: async_schedule_update_ha_state must not be awaited - #42
Fix TypeError in switch.py: async_schedule_update_ha_state must not be awaited#42proscar87 wants to merge 1 commit into
Conversation
The await command on line 474 in switch.py is incorrect, the called function is not a coroutine. (cherry picked from commit 9979bea)
|
Hey! Thanks for the shout-out! I forked it because this repo seems dead, I thought I had pushed PRs #30 and #31 but to be perfectly honest I'm pretty new to open-source and I might have messed it up. My copy of the repo just makes the fixed code available for anyone if they need it. If it's active again, I'll make sure to clean everything up in case I messed it up. |
|
Good news first: you didn't mess anything up. #30 and #31 are correctly filed and still open, exactly where they should be — you can see them in the PR list right alongside mine. Nothing to clean up. The silence isn't yours. The repo's last push is July 2025, and there are eight open PRs from five different people, none answered. Your fork was a reasonable response to that. And I owe you a correction on my own PRs: #30 and #31 are the same two fixes as my #42 and #43, and yours came four months earlier. I found the So for whoever eventually looks at this repo: #30 and #31 have priority. If a maintainer shows up, they should take yours and close mine as duplicates. I'll leave mine open only because more visible reports may help wake the repo up, not because they're the ones worth merging. If they stay unanswered, your fork is genuinely useful to people hitting these bugs — that |
|
That's excellent news, thank you! |
Summary
Fixes #14, #16, and Bug 2 of #28 — the same one-line defect reported three times:
async_schedule_update_ha_state()is a callback that returnsNone; awaiting it raises on every scheduled update.Credit
This is @bsantelicesm's fix, cherry-picked with authorship preserved from their fork (see their comment in #28 — the fixes were sitting there since June without a PR). I'm just upstreaming it so everyone gets it via HACS.
Runs live on my 7-AC ConnectLife household.
🤖 Upstreamed with Claude Code