diff --git a/custom_components/zha_toolkit/utils.py b/custom_components/zha_toolkit/utils.py index cde3c10..ae2b654 100644 --- a/custom_components/zha_toolkit/utils.py +++ b/custom_components/zha_toolkit/utils.py @@ -473,7 +473,7 @@ def dict_to_jsonable(src_dict): value = value.serialize() if isinstance(value, bytes): # "bytes" is not compatible with json, get a "string" - value = str(value, encoding="ascii") + value = str(value, encoding="unicode_escape") else: # Anything else: get a textual representation value = repr(value) diff --git a/custom_components/zha_toolkit/zcl_attr.py b/custom_components/zha_toolkit/zcl_attr.py index c90af58..62e1c96 100644 --- a/custom_components/zha_toolkit/zcl_attr.py +++ b/custom_components/zha_toolkit/zcl_attr.py @@ -78,7 +78,7 @@ async def my_read_reporting_configuration_multiple( record.direction = direction # LOGGER.warning(f"Record {record.direction} {record.attrid}") cfg.append(record) - LOGGER.warning("Read reporting with %s %r", cfg, kwargs) + LOGGER.debug("Read reporting with %s %r", cfg, kwargs) param = t.List[f.ReadReportingConfigRecord](cfg) LOGGER.debug("Resolves to %s", param) @@ -88,9 +88,9 @@ async def my_read_reporting_configuration_multiple( ) try: - LOGGER.warning("Read reporting with %s result %s", cfg, res) + LOGGER.debug("Read reporting with %s result %s", cfg, res) except Exception as e: - LOGGER.debug("Error when reporting result of Read Report %r", e) + LOGGER.warning("Error when reporting result of Read Report %r", e) # Parse configure reporting result for unsupported attributes records = res[0]