Skip to content

Commit

Permalink
Correct bug in generic attribute write handler
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Oct 31, 2023
1 parent ea6268f commit 14279b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/zha_toolkit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,12 +735,12 @@ def attr_encode(attr_val_in, attr_type): # noqa C901
# With length byte after serialisation:
# compare_val = t.LVBytes(attr_val_in)

attr_obj = data_type(compare_val)
attr_obj = f.TypeValue(attr_type, data_type(compare_val))
# Not using : attr_obj = data_type(attr_type, compare_val)
# which may add extra bytes
else:
compare_val = data_type(str2int(attr_val_in))
attr_obj = data_type(attr_type, compare_val)
attr_obj = f.TypeValue(attr_type, compare_val)
LOGGER.debug(
"Converted %s to %s - will compare to %s - Type: 0x%02X",
attr_val_in,
Expand Down

0 comments on commit 14279b8

Please sign in to comment.