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

cast_in Exception, when writing description property #524

Open
juraj3579 opened this issue Feb 7, 2025 · 1 comment
Open

cast_in Exception, when writing description property #524

juraj3579 opened this issue Feb 7, 2025 · 1 comment

Comments

@juraj3579
Copy link

Hello,

after I decided to switch my application to async BAC0 (which made me some headaches, but in the end I could manage it somehow :-) ) I've stumbled upon a problem when trying to write description property of an object.
I could localize the problem to the cast_in function in the Text.py module.

_venv\Lib\site-packages\BAC0\core\functions\Text.py", line 48, in build_text_write_request
    _value.cast_in(CharacterString(value))
TypeError: Any.cast_in() missing 1 required positional argument: 'element'

Checking back in code of BACpypes3 i found out, that the Any() value should be defined with argument or with none.

so changing the definition of _value in the Text.py from

_value = Any()

to

_value = Any(None)

solved the issue for me. Maybe you can checked that out and merge the change later on.

@ChristianTremblay
Copy link
Owner

Thanks for that ! Believe me I feel your pain regarding async. It is a pretty wild change of mindset...

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