Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
pipiche38 committed Feb 14, 2025
1 parent bf25077 commit aac6d4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions Modules/schneider_wiser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1136,27 +1136,28 @@ def schneiderRenforceent(self, NWKID):
return rescheduleAction


def schneider_multiple_read_attribute_request(self, Devices, nwkid, src_ep, dst_ep, sqn, cluster_id, manuf_specif, mabnuf_code, MsgData, nbAttribute):
def schneider_multiple_read_attribute_request(self, Devices, nwkid, src_ep, dst_ep, sqn, cluster_id, manuf_specif, manuf_code, MsgData, nbAttribute):

""" Handle a read request with multiple attributes on cluster 0x0201"""

payload = None
cmd = "01"
status = "00"

# Extract additional message components, and build a response
# Extract all attributes, and build a response
for idx in range(0, len(MsgData), 4):
attribute = MsgData[idx:idx + 4]
self.log.logging("Schneider", "Debug", f"schneider_multiple_read_attribute_request - nwkid {nwkid} attribute {attribute}", nwkid)
self.log.logging("Schneider", "Debug", f"Decode0100 - schneider_multiple_read_attribute_request - nwkid {nwkid} attribute {attribute}", nwkid)

# Handle different cluster IDs and attributes
zigate_ep, cluster_frame, data_type, data = get_response_data_for_schneider_thermostat_request(self, Devices, nwkid, src_ep, attribute)
self.log.logging("Schneider", "Debug", f"schneider_multiple_read_attribute_request - response {data_type} {data}", nwkid)
self.log.logging("Schneider", "Debug", f"Decode0100 - schneider_multiple_read_attribute_request - response {data_type} {data}", nwkid)
if payload is None:
payload = cluster_frame + sqn + cmd
payload += attribute[2:4] + attribute[:2] + status + data_type
payload += data[2:4] + data[:2] if data_type == "29" else data

self.log.logging("Schneider", "Debug", f"schneider_multiple_read_attribute_request Response - nwkid {nwkid} ep: {src_ep} , clusterId: {cluster_id}, sqn: {sqn},payload: {payload}", nwkid)
self.log.logging("Schneider", "Debug", f"Decode0100 - schneider_multiple_read_attribute_request Response - nwkid {nwkid} ep: {src_ep} , clusterId: {cluster_id}, sqn: {sqn},payload: {payload}", nwkid)

raw_APS_request( self, nwkid, src_ep, cluster_id, "0104", payload, zigate_ep=zigate_ep, ackIsDisabled=is_ack_tobe_disabled(self, nwkid), )

Expand Down
2 changes: 1 addition & 1 deletion Z4D_decoders/z4d_decoder_Read_Attribute_Request.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def Decode0100(self, Devices, MsgData, MsgLQI):
manuf_name = self.ListOfDevices[MsgSrcAddr].get('Manufacturer Name', '')

if MsgClusterId == '0201' and (manuf == '105e' or manuf_name in ('Schneider', 'Schneider Electric')) and int(nbAttribute) > 1:
self.log.logging('Input', 'Debug', 'Decode0100 - specific ---- schneider_multiple_read_attribute_request')
self.log.logging(['Input', 'Schneider'], 'Debug', 'Decode0100 - specific ---- schneider_multiple_read_attribute_request')
schneider_multiple_read_attribute_request(self, Devices, MsgSrcAddr, MsgSrcEp, MsgDstEp, MsgSqn, MsgClusterId, MsgManufSpec, MsgManufCode, MsgData[24:], nbAttribute)
return

Expand Down

0 comments on commit aac6d4c

Please sign in to comment.