robert-hh / Onewire_DS18X20

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

Convenience for reading a single DS18X20 sensor #11

Closed amotl closed 4 years ago

amotl commented 4 years ago

@robert-hh likes to have a convenience functionality for reading a single DS18X20 sensor attached to the 1-Wire bus through a code fragment like

if (rom is None) and (len(self.roms) == 1):
    rom = self.roms[0]

I am proposing to add this functionality through some kind of adapter class like DS18X20Single in order not to clutter the core implementation.

amotl commented 4 years ago

I've added the proposed adapter class through the commit de990de2 referenced above. However, it will not convert into a pull request easily as the commit history seems to have been amended on the upstream repository.

robert-hh commented 4 years ago

That's obsolete by now.