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

Cannot write floating point values with _write() #493

Open
skygreenslade opened this issue Oct 28, 2024 · 4 comments
Open

Cannot write floating point values with _write() #493

skygreenslade opened this issue Oct 28, 2024 · 4 comments

Comments

@skygreenslade
Copy link

I cannot write floating point values with _write(). Instead "null" is being written, and no error or return value is provided.

Example which creates the issue:

async with BAC0.start(ip=_ip) as bacnet:
        result = await bacnet._write(f'{_device_ip}:{_port} analogOutput 1 presentValue 0.1 - 3')
        print(f'\nResult: {result}\n')

Output (truncated):

Result: None

I think this may be due to the regex parsing the write arguments parsing a word for the value. Is there any workaround for this?

@ChristianTremblay
Copy link
Owner

I'm pretty sure the write function doesn't return something.

I just send this to the network

I highly suggest you to have wireshark open. Just to see what is going on on the network.

@skygreenslade
Copy link
Author

I don't have my wireshark logs from this anymore, I have since moved on from it. I was able to verify that using the script shown above correctly sends 'NULL' to the device rather than the float value.

The return value thing is more of an aside, the function documentation states that it will return something, and if the communication failed there are some exceptions that may be raised, so I wanted to rule out that first step.

@ChristianTremblay
Copy link
Owner

you were right on the regex. Thanks
Please try the develop branch

I also added the return response to the _write fucntion, tell me if this works for you

@skygreenslade
Copy link
Author

Thanks for the update! I am currently working on other projects, but I will follow up if I am able to test out the new functionality.

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

No branches or pull requests

2 participants