BAC0 icon indicating copy to clipboard operation
BAC0 copied to clipboard

ReadMultiple w/ request_dict bug fix

Open alecjohanson opened this issue 1 year ago • 4 comments

This may be fixing the

TODO : Need improvement here and look for the property identifier that is coming from the response
            Then we'll be able to support multiple properties for the same object in the read multiple function

This fixes an issue when for example, reading with a request dict like:

binary_iov = {
    'address': "<ip>", 
    'objects': {
        'binaryInput:1': ['objectName', 'presentValue'],
<...>
        'binaryInput:8': ['objectName', 'presentValue'],

        'binaryOutput:1': ['objectName', 'presentValue'],
<...>
        'binaryOutput:8': ['objectName', 'presentValue'],

        'binaryValue:1': ['objectName', 'presentValue'],
        'binaryValue:2': ['objectName', 'presentValue'],
        'binaryValue:3': ['objectName', 'presentValue'],
<...>
        'binaryValue:16': ['objectName', 'presentValue']
    }
}

Then calling: my_controller.properties.network.readMultiple(<ip>, request_dict=binary_iov)

Without this change, the returned value has the form

{
    'binary-input,1': [(<PropertyIdentifier: present-value>, <BinaryPV: inactive>)],
    ...
    'binary-value,16': [(<PropertyIdentifier: present-value>, <BinaryPV: inactive>)],
}

Not including the requested objectName

With this change the returned value has the form:

{
     'binary-input,1': [(<PopertyIndentifier: object-name>, 'BI 1'), (<PropertyIdentifier: present-value>, <BinaryPV: inactive>)],
    ...
     'binary-value,16': [(<PopertyIndentifier: object-name>, 'BV 16'), (<PropertyIdentifier: present-value>, <BinaryPV: inactive>)],
}

Which includes the requested object-name and present-value

alecjohanson avatar Dec 13 '24 21:12 alecjohanson

I'll have a look. Thanks

ChristianTremblay avatar Dec 17 '24 03:12 ChristianTremblay

@ChristianTremblay I am facing the same issue while using readMultiple with request_dict. Any updates on this issue or are there any workarounds for reading properties of multiple objects in one go.

kuriakosejohn avatar Feb 03 '25 18:02 kuriakosejohn

This pull request has not been processed yet, please proceed or close.

github-actions[bot] avatar Apr 05 '25 02:04 github-actions[bot]

This pull request has not been processed yet, please proceed or close.

github-actions[bot] avatar Jun 12 '25 02:06 github-actions[bot]