Skip to content
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

Purge quirks on reload #3328

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion zhaquirks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import zigpy.device
import zigpy.endpoint
from zigpy.quirks import CustomCluster, CustomDevice
from zigpy.quirks import DEVICE_REGISTRY, CustomCluster, CustomDevice
import zigpy.types as t
from zigpy.util import ListenableMixin
from zigpy.zcl import foundation
Expand Down Expand Up @@ -432,6 +432,9 @@ async def command(self, command, *args, expect_reply=None, **kwargs):
def setup(custom_quirks_path: str | None = None) -> None:
"""Register all quirks with zigpy, including optional custom quirks."""

if custom_quirks_path is not None:
DEVICE_REGISTRY.purge_custom_quirks(custom_quirks_path)

# Import all quirks in the `zhaquirks` package first
for _importer, modname, _ispkg in pkgutil.walk_packages(
path=__path__,
Expand Down
Loading