Don't remove the WLED stop listener twice on unload by frenck · Pull Request #184412 · home-assistant/core · GitHub
Skip to content

Don't remove the WLED stop listener twice on unload - #184412

Merged
epenet merged 1 commit into
home-assistant:devfrom
frenck:frenck/wled-unload-unsub
Oct 6, 2026
Merged

epenet merged 1 commit into
home-assistant:devfrom
frenck:frenck/wled-unload-unsub

Conversation

@frenck

@frenck frenck commented Oct 6, 2026

Copy link
Copy Markdown
Member

Breaking change

Proposed change

Unloading a WLED entry with an open WebSocket removed the listener for Home Assistant stopping, and the WebSocket listener, ended by that same disconnect, removed it again. That logs "Unable to remove unknown job listener" with a traceback.

The unload now clears it after removing it, so whichever of the two comes second skips it.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

Copilot AI balanced review requested due to automatic review settings October 6, 2026 06:46
@home-assistant home-assistant Bot added bugfix cla-signed has-tests integration: wled small-pr PRs with less than 30 lines. Top 100 Integration is ranked within the top 100 by usage Top 200 Integration is ranked within the top 200 by usage by-code-owner Quality Scale: platinum labels Oct 6, 2026
@home-assistant

home-assistant Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The targeted lifecycle fix is correct and covered by a focused regression test.

Review effort: Balanced
Findings: None

What changed in this PR

Prevents duplicate WLED stop-listener removal during config-entry unload.

Changes:

  • Clears the unsubscribe callback after invocation.
  • Adds regression coverage for unloading an active WebSocket listener.
File Description
homeassistant/​components/​wled/​__init__.py Prevents duplicate listener cleanup.
tests/​components/​wled/​test_init.py Tests error-free WebSocket unload.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@epenet
epenet merged commit 93d429c into home-assistant:dev Oct 6, 2026
37 checks passed
VladislavLevitskii pushed a commit to VladislavLevitskii/core that referenced this pull request Oct 6, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bugfix by-code-owner cherry-picked cla-signed has-tests integration: wled Quality Scale: platinum small-pr PRs with less than 30 lines. Top 100 Integration is ranked within the top 100 by usage Top 200 Integration is ranked within the top 200 by usage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants