rbp_ds18b20 package

rbp_ds18b20.rbp_ds18b20 module

class rbp_ds18b20.rbp_ds18b20.Check(log=None)[source]
w1_config()[source]

Public function:w1_config checks the config.txt file for the entry ‘dtoverlay=w1-gpio’.

Returns:Returns True if check passed. Otherwise None.
w1_modules()[source]

Public function:w1_modules checks the file modules for the entries ‘w1-therm’ and ‘w1-gpio’.

Returns:Returns True if check passed. Otherwise None.
class rbp_ds18b20.rbp_ds18b20.Temp(check=None, csv=None, log=None, level=None)[source]
read_once()[source]

Public function:read_one reads all connected sensors.

If attribute internal variable:csv=True, the results are written into the created csv-export file. If internal variable:csv=None, nothing is written into any file.

Returns:Returns a dictionary containing sensor names as keys and temperatures as values.
start_read(interval=None, daemon=None, join=None, duration=None)[source]

Public function:start_read starts a thread to read connected sensors within an specified interval.

Parameters:
  • interval – If interval=None, the interval time is set to 60 seconds. Otherwise an integer is expected telling the interval time.
  • daemon – If daemon=None, the thread is executed until it gets stopped manually using the public function:stop_read. If daemon=True, the thread is started in background without blocking the main script.
  • join – If join=True, the thread block the main script until the thread is stopped manually by calling the public function:stop_read.
  • duration – If duration=None, the duration is infinite and the thread needs to be stopped manually. Otherwise an integer is expected to determine maximum duration.
Returns:

Returns None.

stop_read()[source]

Public function:stop_read stops the started thread to read the connected sensors in a fixed interval.

Returns:Returns None.