Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Add possibility to use old format without floating point #2

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/onewire/onewire.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,13 @@ def _search_rom(self, l_rom, diff):
return rom, next_diff

class DS18X20(object):
def __init__(self, onewire):
def __init__(self, onewire, useFloat=True):
self.ow = onewire
self.roms = [rom for rom in self.ow.scan() if rom[0] == 0x10 or rom[0] == 0x28]
self.fp = True
self.fp = useFloat
try:
1/1
if useFloat:
1/1
except TypeError:
self.fp = False # floatingpoint not supported

Expand Down