Skip to content

Deprecate auto_mode#382

Merged
dwalton76 merged 3 commits intoev3dev:developfrom
dwalton76:ev3g-api-deprecate-auto-mode
Sep 29, 2017
Merged

Deprecate auto_mode#382
dwalton76 merged 3 commits intoev3dev:developfrom
dwalton76:ev3g-api-deprecate-auto-mode

Conversation

@dwalton76
Copy link
Copy Markdown
Collaborator

No description provided.

@dwalton76
Copy link
Copy Markdown
Collaborator Author

For issue #378

Comment thread ev3dev/core.py Outdated
"""

# If 'mode' is already set to 'value' there is nothing to do.
if value == self._mode_value:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want a way to bypass this cache logic? Previously, the sysfs accessors were always guaranteed to perform a write operation, whereas now there's no way to handle the case where you intentionally want multiple processes interfacing with the same device. This is a result of the fact that caching was moved down a level from the friendly functions to the getters/setters.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of me is wondering if we need it at all. We didn't have it before and I've never noticed any perf issues with setting the modes. We aren't setting the mode any more often with the deprecation of auto_mode (assuming nobody ever set this to false). Maybe we just chop the mode_value/caching part of this patch?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WasabiFan what say you on the mode_value...keep or chop? I'm leaning towards chop and address it as part of #365

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I don't like the inconsistency this introduces, especially in light of cases such as the ultrasonic sensor where the only way to send a ping is to set the mode again. We should cut it from here and address it elsewhere.

@dwalton76
Copy link
Copy Markdown
Collaborator Author

Removed _mode_value, merging

@dwalton76 dwalton76 merged commit 2fa6cb0 into ev3dev:develop Sep 29, 2017
@dwalton76 dwalton76 deleted the ev3g-api-deprecate-auto-mode branch September 29, 2017 01:58
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