Skip to content

Commit 08e40db

Browse files
authored
Update Berry.md
Updated example hex formatting from Ox to 0x
1 parent 02e410e commit 08e40db

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/Berry.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2347,16 +2347,16 @@ Example, if you want to dump all the traffic passed:
23472347
import zigbee
23482348
class my_zb_handler
23492349
def frame_received(event_type, frame, attr_list, idx)
2350-
print(f"shortaddr=Ox{idx:04X} {event_type=} {frame=}")
2350+
print(f"shortaddr=0x{idx:04X} {event_type=} {frame=}")
23512351
end
23522352
def attributes_raw(event_type, frame, attr_list, idx)
2353-
print(f"shortaddr=Ox{idx:04X} {event_type=} {attr_list=}")
2353+
print(f"shortaddr=0x{idx:04X} {event_type=} {attr_list=}")
23542354
end
23552355
def attributes_refined(event_type, frame, attr_list, idx)
2356-
print(f"shortaddr=Ox{idx:04X} {event_type=} {attr_list=}")
2356+
print(f"shortaddr=0x{idx:04X} {event_type=} {attr_list=}")
23572357
end
23582358
def attributes_final(event_type, frame, attr_list, idx)
2359-
print(f"shortaddr=Ox{idx:04X} {event_type=} {attr_list=}")
2359+
print(f"shortaddr=0x{idx:04X} {event_type=} {attr_list=}")
23602360
end
23612361
23622362
end
@@ -2366,10 +2366,10 @@ zigbee.add_handler(my_handler)
23662366
23672367
# example of reading for a plug
23682368
#
2369-
# 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}
2370-
# shortaddr=OxC1BC event_type=attributes_raw attr_list={"000C/0055":261.612,"Endpoint":21,"LinkQuality":21}
2371-
# shortaddr=OxC1BC event_type=attributes_refined attr_list={"ActivePower":261.612,"(ActivePower)":"0B04/050B","Endpoint":21,"LinkQuality":21}
2372-
# shortaddr=OxC1BC event_type=attributes_final attr_list={"ActivePower":261.612,"(ActivePower)":"0B04/050B","Endpoint":21,"LinkQuality":21}
2369+
# 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}
2370+
# shortaddr=0xC1BC event_type=attributes_raw attr_list={"000C/0055":261.612,"Endpoint":21,"LinkQuality":21}
2371+
# shortaddr=0xC1BC event_type=attributes_refined attr_list={"ActivePower":261.612,"(ActivePower)":"0B04/050B","Endpoint":21,"LinkQuality":21}
2372+
# shortaddr=0xC1BC event_type=attributes_final attr_list={"ActivePower":261.612,"(ActivePower)":"0B04/050B","Endpoint":21,"LinkQuality":21}
23732373
23742374
# to remove handler:
23752375
# zigbee.remove_handler(my_handler)

0 commit comments

Comments
 (0)