robert-hh / Onewire_DS18X20

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

Avoid confusion within "start_conversion" and "read_temp_async" methods #2

Closed amotl closed 4 years ago

amotl commented 4 years ago

Hi again,

while I will be happy to add a pull request about this soon, I just wanted to outline a small improvement I would like to make.

I propose to completely remove a piece of code which could lead to potential confusion by falling back to the first entry in the list of addressable devices in both start_conversion and read_temp_async.

  if (rom==None) and (len(self.roms)>0):
      rom=self.roms[0]
  if rom!=None:

With kind regards, Andreas.

amotl commented 4 years ago

Closing this in favor of #11.