androidthings / contrib-drivers

Open source peripheral drivers
Apache License 2.0
560 stars 174 forks source link

Added name() method to identify a button #96

Closed david-fournier-smartnsoft closed 6 years ago

googlebot commented 6 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers
david-fournier-smartnsoft commented 6 years ago

I signed it!

googlebot commented 6 years ago

CLAs look good, thanks!

Fleker commented 6 years ago

I'm not sure if knowing the generic name of the GPIO pin is particularly helpful. You may want to keep track of this in your own application using more specific naming for your application. In the RainbowHat driver for example, it abstracts the three buttons to more specific names like openButtonA

devunwired commented 6 years ago

Gpio exposes this attribute, so bubbling it up through the Button seems pretty benign to me. However, I would recommend exposing the actual GPIO value rather than tracking the string independently. Comments added to the code.