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

[gpio] Added parameter for pull up/down resistor and other improvements #10782

Merged
merged 5 commits into from Jun 7, 2021
Merged

[gpio] Added parameter for pull up/down resistor and other improvements #10782

merged 5 commits into from Jun 7, 2021

Conversation

SloCompTech
Copy link
Contributor

@SloCompTech SloCompTech commented May 30, 2021

[gpio] Added parameter for pull up/down resistor for GPIO binding

Changes:

  • Added Pull Up/Down parameter to input GPIO pin configuration
  • GPIO pin mode set with library constant instead of integer
  • Updated README.md of binding (added information about new parameter)
  • Improved README.md of binding with some additional info
  • Also ran static code analysis
  • Tested on my setup, no problems detected

Most of changes were implemeted by @sjoerdtakken (Forum post, His repo with changes), but not commited to this repo.

Here is compiled version: org.openhab.binding.gpio-3.1.0.zip

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/gpio-new-gpio-binding-for-oh3/113943/59

@SloCompTech SloCompTech reopened this May 30, 2021
@SloCompTech
Copy link
Contributor Author

With little "workout" fixed issues with signing-off commits

bundles/org.openhab.binding.gpio/README.md Outdated Show resolved Hide resolved
@@ -78,7 +81,7 @@ Thing gpio:pigpio-remote:sample-pi-1 "Sample-Pi 1" [host="192.168.2.36", port=88
Thing gpio:pigpio-remote:sample-pi-2 "Sample-Pi 2" [host="192.168.2.37", port=8888] {
Channels:
Type pigpio-digital-input : sample-input-3 [ gpioId=16, debouncingTime=20]
Type pigpio-digital-input : sample-input-4 [ gpioId=17, invert=true, debouncingTime=5]
Type pigpio-digital-input : sample-input-4 [ gpioId=17, invert=true, debouncingTime=5, pullupdown=2]
Copy link
Member

Choose a reason for hiding this comment

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

It feels like a very direct way, would it make sense to expose a bit less direct, or not. I'm in doubt.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have you got any suggestion for improvement ?

Copy link
Member

Choose a reason for hiding this comment

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

Do you mean like pullupdown=OFF, pullupdown=UP, pullupdown=DOWN? Would be better from the usability perspective, IMHO. But I won't insist on changing it.

Copy link
Member

Choose a reason for hiding this comment

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

Let's merge it then

Copy link
Member

Choose a reason for hiding this comment

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

OK, @SloCompTech feel free to file a follow-up PR if you agree on these thoughts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, will do, so I need to change parameter type to string or is there another more suitable type like a constant ?

Copy link
Member

Choose a reason for hiding this comment

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

There's no enum type or so. You need to make it text. See https://www.openhab.org/docs/developer/bindings/config-xml.html#xml-structure-for-configuration-descriptions for the available types.

Signed-off-by: Martin <martin.dagarin@gmail.com>
Signed-off-by: Martin <martin.dagarin@gmail.com>
Signed-off-by: Martin <martin.dagarin@gmail.com>
Signed-off-by: Martin <martin.dagarin@gmail.com>
Signed-off-by: Martin <martin.dagarin@gmail.com>
@martinvw
Copy link
Member

martinvw commented Jun 7, 2021

@fwolter what do you think?

@SloCompTech
Copy link
Contributor Author

SloCompTech commented Jun 13, 2021

I created follow up PR #10862, but I have problems with signing-off, so I deleted my whole fork, which had a lot of sign-off issues, and created fresh fork and applied changes there in new PR #10863

@wborn wborn added this to the 3.1 milestone Jun 25, 2021
computergeek1507 pushed a commit to computergeek1507/openhab-addons that referenced this pull request Jul 13, 2021
lucacalcaterra pushed a commit to lucacalcaterra/openhab-addons that referenced this pull request Jul 26, 2021
…ts (openhab#10782)

Signed-off-by: Luca Calcaterra <calcaterra.luca@gmail.com>
lucacalcaterra pushed a commit to lucacalcaterra/openhab-addons that referenced this pull request Jul 26, 2021
…ts (openhab#10782)

Signed-off-by: Luca Calcaterra <calcaterra.luca@gmail.com>
lucacalcaterra pushed a commit to lucacalcaterra/openhab-addons that referenced this pull request Aug 3, 2021
…ts (openhab#10782)

Signed-off-by: Luca Calcaterra <calcaterra.luca@gmail.com>
frederictobiasc pushed a commit to frederictobiasc/openhab-addons that referenced this pull request Oct 26, 2021
thinkingstone pushed a commit to thinkingstone/openhab-addons that referenced this pull request Nov 7, 2021
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this pull request May 5, 2022
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.

None yet

5 participants