robert-hh / Onewire_DS18X20

Classes for driving the DS18x20 sensor with the onewire protocol for Pycom MicroPython
11 stars 6 forks source link

Add convenience adapter class for reading a single DS18X20 sensor #15

Closed amotl closed 4 years ago

amotl commented 4 years ago

Dear Robert,

this reimplements some bits of your original improved driver from https://github.com/pycom/pycom-libraries/pull/62 using a minimal adapter class.

This might resolve #11 in a non-intrusive way. It separates concerns and by adding it through a distinct file, the code can be optionally imported by anyone who needs this feature.

If you still like to see that convenience feature, you might want to have this available. If not, feel free to close the PR right away.

With kind regards, Andreas.

robert-hh commented 4 years ago

Does not work like that, since there is not self.roms stored in the DS18X20 driver. I had to add an init which get the list of roms. Also, init of the DS18X20 class had to be called. Edit: So I will not merge that PR, but do a manual copy & paste. Thanks

amotl commented 4 years ago

Does not work like that, since there is not self.roms stored in the DS18X20 driver.

Oops, I missed that detail. The adapter class was thought to be a kind of sketch, sorry that I forgot to outline this appropriately and thanks again for taking care about the details.