Skip to content

Commit

Permalink
Update Berry.md
Browse files Browse the repository at this point in the history
Updated example hex formatting from Ox to 0x
  • Loading branch information
sfromis authored Dec 12, 2024
1 parent 02e410e commit 08e40db
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/Berry.md
Original file line number Diff line number Diff line change
Expand Up @@ -2347,16 +2347,16 @@ Example, if you want to dump all the traffic passed:
import zigbee
class my_zb_handler
def frame_received(event_type, frame, attr_list, idx)
print(f"shortaddr=Ox{idx:04X} {event_type=} {frame=}")
print(f"shortaddr=0x{idx:04X} {event_type=} {frame=}")
end
def attributes_raw(event_type, frame, attr_list, idx)
print(f"shortaddr=Ox{idx:04X} {event_type=} {attr_list=}")
print(f"shortaddr=0x{idx:04X} {event_type=} {attr_list=}")
end
def attributes_refined(event_type, frame, attr_list, idx)
print(f"shortaddr=Ox{idx:04X} {event_type=} {attr_list=}")
print(f"shortaddr=0x{idx:04X} {event_type=} {attr_list=}")
end
def attributes_final(event_type, frame, attr_list, idx)
print(f"shortaddr=Ox{idx:04X} {event_type=} {attr_list=}")
print(f"shortaddr=0x{idx:04X} {event_type=} {attr_list=}")
end
end
Expand All @@ -2366,10 +2366,10 @@ zigbee.add_handler(my_handler)
# example of reading for a plug
#
# shortaddr=OxC1BC event_type=frame_received frame={'srcendpoint': 21, 'transactseq_set': 0, 'shortaddr': 49596, 'dstendpoint': 1, 'payload': bytes('5500003956CE8243'), 'shortaddr_hex': '0xC1BC', 'manuf': 0, 'payload_ptr': <ptr: 0x3ffccb5c>, 'need_response': 0, 'transactseq': 25, 'cmd': 1, 'direct': 0, 'cluster': 12, 'cluster_specific': 0, 'groupaddr': 0}
# shortaddr=OxC1BC event_type=attributes_raw attr_list={"000C/0055":261.612,"Endpoint":21,"LinkQuality":21}
# shortaddr=OxC1BC event_type=attributes_refined attr_list={"ActivePower":261.612,"(ActivePower)":"0B04/050B","Endpoint":21,"LinkQuality":21}
# shortaddr=OxC1BC event_type=attributes_final attr_list={"ActivePower":261.612,"(ActivePower)":"0B04/050B","Endpoint":21,"LinkQuality":21}
# shortaddr=0xC1BC event_type=frame_received frame={'srcendpoint': 21, 'transactseq_set': 0, 'shortaddr': 49596, 'dstendpoint': 1, 'payload': bytes('5500003956CE8243'), 'shortaddr_hex': '0xC1BC', 'manuf': 0, 'payload_ptr': <ptr: 0x3ffccb5c>, 'need_response': 0, 'transactseq': 25, 'cmd': 1, 'direct': 0, 'cluster': 12, 'cluster_specific': 0, 'groupaddr': 0}
# shortaddr=0xC1BC event_type=attributes_raw attr_list={"000C/0055":261.612,"Endpoint":21,"LinkQuality":21}
# shortaddr=0xC1BC event_type=attributes_refined attr_list={"ActivePower":261.612,"(ActivePower)":"0B04/050B","Endpoint":21,"LinkQuality":21}
# shortaddr=0xC1BC event_type=attributes_final attr_list={"ActivePower":261.612,"(ActivePower)":"0B04/050B","Endpoint":21,"LinkQuality":21}
# to remove handler:
# zigbee.remove_handler(my_handler)
Expand Down

0 comments on commit 08e40db

Please sign in to comment.