Source : utils

source code: utils

Utility functions.

C2F(celsius) Convert celsius to fahrenheit.
run_in_thread(func) (decorator) run func in thread USAGE.
smooth(reading, factor, previous) apply smoothing function
dhtioc.utils.C2F(celsius)[source]

Convert celsius to fahrenheit.

dhtioc.utils.run_in_thread(func)[source]

(decorator) run func in thread USAGE:

@run_in_thread
def progress_reporting():
    logger.debug("progress_reporting is starting")
    # ...
#...
progress_reporting()   # runs in separate thread
#...
dhtioc.utils.smooth(reading, factor, previous)[source]

apply smoothing function

smoothed = k*raw + (1-k)*previous