Skip to content

Commit

Permalink
Purge quirks on reload (#3328)
Browse files Browse the repository at this point in the history
  • Loading branch information
puddly authored Aug 28, 2024
1 parent 4c3729b commit 5c4e08d
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit 5c4e08d

Please sign in to comment.