Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReadMultiple w/ request_dict bug fix #507

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

alecjohanson
Copy link

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

…verwriting with an empty array, losing information
@ChristianTremblay ChristianTremblay changed the base branch from main to develop December 17, 2024 03:48
@ChristianTremblay
Copy link
Owner

I'll have a look. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants