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

Handle user supplied LineRequest/offset. #4

Merged
merged 1 commit into from
Apr 23, 2024
Merged

Conversation

Gadgetoid
Copy link
Member

Client libraries will use get_pin() to resolve a user-supplied or default pin label to a gpiochip and line offset.

This is intended to fix the issues with Buster not including pin labels - pimoroni/enviroplus-python#137 - though we do not want to make a habit of supporting anything older than Bullseye.

This should also fix other cases where a user supplies a (LineRequest, offset) tuple instead of a "GPIO27" label. Since the user has already done the legwork of requesting the pin and supplying it to the library, we can return it verbatim. This avoids having to handle this behaviour in every client library.

Client libraries will use get_pin() to resolve a user-supplied or
default pin label to a gpiochip and line offset.

If the user decides to supply a LineRequest, offset tuple instead,
then simply return it. This avoids having to handle this behaviour
in every client library.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 8802799399

Details

  • 0 of 2 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.4%) to 41.743%

Changes Missing Coverage Covered Lines Changed/Added Lines %
gpiodevice/init.py 0 2 0.0%
Totals Coverage Status
Change from base Build 7960077441: -0.4%
Covered Lines: 91
Relevant Lines: 218

💛 - Coveralls

@Gadgetoid Gadgetoid merged commit 1e41e0c into main Apr 23, 2024
7 checks passed
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