Skip to content

Commit

Permalink
Add logging to LocalDataCluster (#3408)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmulcahey authored Oct 10, 2024
1 parent fa0d9fa commit 7d81ef9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions zhaquirks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,23 @@ class LocalDataCluster(CustomCluster):

async def bind(self):
"""Prevent bind."""
self.debug("binding LocalDataCluster")
return (foundation.Status.SUCCESS,)

async def unbind(self):
"""Prevent unbind."""
self.debug("unbinding LocalDataCluster")
return (foundation.Status.SUCCESS,)

async def _configure_reporting(self, *args, **kwargs): # pylint: disable=W0221
"""Prevent remote configure reporting."""
self.debug("configuring reporting for LocalDataCluster")
return (foundation.ConfigureReportingResponse.deserialize(b"\x00")[0],)

async def read_attributes_raw(self, attributes, manufacturer=None):
"""Prevent remote reads."""
msg = "reading attributes for LocalDataCluster"
self.debug(f"{msg}: attributes={attributes} manufacturer={manufacturer}")
records = [
foundation.ReadAttributeRecord(
attr, foundation.Status.UNSUPPORTED_ATTRIBUTE, foundation.TypeValue()
Expand All @@ -95,6 +100,8 @@ async def read_attributes_raw(self, attributes, manufacturer=None):

async def write_attributes(self, attributes, manufacturer=None):
"""Prevent remote writes."""
msg = "writing attributes for LocalDataCluster"
self.debug(f"{msg}: attributes={attributes} manufacturer={manufacturer}")
for attrid, value in attributes.items():
if isinstance(attrid, str):
attrid = self.attributes_by_name[attrid].id
Expand Down

0 comments on commit 7d81ef9

Please sign in to comment.