diff --git a/zhaquirks/__init__.py b/zhaquirks/__init__.py index 3aca7f8f58..fd419f7893 100644 --- a/zhaquirks/__init__.py +++ b/zhaquirks/__init__.py @@ -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 @@ -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__,