aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDamien George2019-10-16 14:27:01 +1100
committerDamien George2019-10-16 14:28:13 +1100
commit595438785879552912a1a6832a4f2715f4e82272 (patch)
tree13ae28b3606733ceb3e55f90b9b4bb3c37c249df /drivers
parent615d6b3c66da710d2b43de9ad889eae4fd6bd366 (diff)
drivers/onewire/ds18x20.py: Add support for DS1822 sensor.
DS1822P sensors behave just like the DS18B20 except for the following: - it has a different family code: 0x22 - it has only the GND and DQ pins connected, it uses parasitic power from the data line Contributed by @nebelgrau77.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/onewire/ds18x20.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/onewire/ds18x20.py b/drivers/onewire/ds18x20.py
index bf0609483..272642239 100644
--- a/drivers/onewire/ds18x20.py
+++ b/drivers/onewire/ds18x20.py
@@ -13,7 +13,7 @@ class DS18X20:
self.buf = bytearray(9)
def scan(self):
- return [rom for rom in self.ow.scan() if rom[0] == 0x10 or rom[0] == 0x28]
+ return [rom for rom in self.ow.scan() if rom[0] in (0x10, 0x22, 0x28)]
def convert_temp(self):
self.ow.reset(True)