hlw8012 icon indicating copy to clipboard operation
hlw8012 copied to clipboard

No way to handle a SEL pin that's just tied to a pullup or pulldown

Open xoseperez opened this issue 7 years ago • 2 comments

Originally reported by: pjz (Bitbucket: pjz, GitHub: pjz)


There's not a good way to use this library with a SEL pin that's not tied to a GPIO.

xoseperez avatar Feb 01 '18 05:02 xoseperez

Original comment by pjz (Bitbucket: pjz, GitHub: pjz):


I presented you with my first PR ( https://bitbucket.org/xoseperez/hlw8012/pull-requests/2 ), but you wanted a different API than I proposed. I tried to fix it in another PR ( https://bitbucket.org/xoseperez/hlw8012/pull-requests/3 ) but you again expressed dissatisfaction with that API. Could you please present an API you'd be happy with, and I'd be happy to write the code for it? I'd like to get this fixed.

xoseperez avatar Feb 22 '18 01:02 xoseperez

Just found a nice device that uses hardwired SEL and ignores CF1: shelly1pf (from shelly.cloud ). What about just passing an invalid pin (42? :) ) as CF1 pin and SEL pin? Should require minimal changes. Obviously some methods will be useless: is it better to return 'invalid' values or an exception?

NdK73 avatar May 28 '19 17:05 NdK73