-
Notifications
You must be signed in to change notification settings - Fork 25
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
Support for rotary encoder #12
Conversation
tests/test_rotencoder.py
Outdated
import unittest | ||
|
||
from unittest.mock import patch | ||
from mopidy_raspberry_gpio import RotEncoder |
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.
Should be:
from mopidy_raspberry_gpio.rotencoder import RotEncoder
Tests pass locally for me with this change.
Codecov Report
@@ Coverage Diff @@
## master #12 +/- ##
==========================================
+ Coverage 91.08% 94.76% +3.67%
==========================================
Files 2 4 +2
Lines 101 172 +71
==========================================
+ Hits 92 163 +71
Misses 9 9
Continue to review full report at Codecov.
|
@Gadgetoid thanks for the hint. |
Thanks for the awesome addition to this library! Now to... uh... figure out how to release this sucker. It's been a while. |
In case it is possible to add this somehow: the contributions of this pull request was joint work with @bombadil. |
Adds support for rotary encoders (potential fix for #11). Two pins can be linked by specifying the same id for the
rotenc_id
option e.g.:In principle multiple rotary encoders should be supported, simply use different
rotenc_ids
.In case you want to use the reverse rotation simply swap the events in the first argument to the bcm specification.