-
Notifications
You must be signed in to change notification settings - Fork 96
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
Make AdsSymbol even more pythonic #192
Conversation
Automatically write value to plc if auto_update is True.
Make the API more Pythonic.
Pull Request Test Coverage Report for Build 556
💛 - Coveralls |
@RobertoRoos I made some minor API-changes to make AdsSymbol class more pythonic. You might want to have a look at it and tell me if you approve it. |
pyads/symbol.py
Outdated
""" | ||
self._value = val | ||
# write value to plc if auto_update is enabled | ||
if self._auto_update_handle is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if self.auto_update
it's a little easier to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good suggestion. I implemented the auto_update property after the value property so I didn' t see this. I will change it.
I am personally not the biggest fan of magic properties, but I understand this is considered good practice. Placed a teeny-tiny comment, I like your changes. Thank you for asking me. |
@RobertoRoos thanks for having a quick look at it :) |
The purpose of this PR is to make the great AdsSymbol class even more Pythonic by: