Skip to content

Commit

Permalink
keep callback bindings on connection close
Browse files Browse the repository at this point in the history
  • Loading branch information
genesiscrew committed May 22, 2024
1 parent 86aa8f8 commit e3ecced
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Tests for api."""
"""Tests for api."""
2 changes: 1 addition & 1 deletion tests/api/test_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def test_api_close(connected_zboss, mocker):
def dict_minus(d, minus):
return {k: v for k, v in d.items() if k not in minus}

ignored_keys = ["_blocking_request_lock", "nvram"]
ignored_keys = ["_blocking_request_lock", "nvram", "_listeners"]

# Closing ZBOSS should reset it completely to that of a fresh object
# We have to ignore our mocked method and the lock
Expand Down
1 change: 0 additions & 1 deletion zigpy_zboss/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ def close(self) -> None:
for listener in listeners:
listener.cancel()

self._listeners.clear()
self.version = None
self.capabilities = None

Expand Down

0 comments on commit e3ecced

Please sign in to comment.