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

Add logging to LocalDataCluster #3408

Merged
merged 5 commits into from
Oct 10, 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
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 @@

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

async def unbind(self):
"""Prevent unbind."""
self.debug("unbinding LocalDataCluster")

Check warning on line 74 in zhaquirks/__init__.py

View check run for this annotation

Codecov / codecov/patch

zhaquirks/__init__.py#L74

Added line #L74 was not covered by tests
return (foundation.Status.SUCCESS,)

async def _configure_reporting(self, *args, **kwargs): # pylint: disable=W0221
"""Prevent remote configure reporting."""
self.debug("configuring reporting for LocalDataCluster")

Check warning on line 79 in zhaquirks/__init__.py

View check run for this annotation

Codecov / codecov/patch

zhaquirks/__init__.py#L79

Added line #L79 was not covered by tests
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 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
Loading