From cda1352a7ce0248e6db1996d9ddb9dbee2f91e8b Mon Sep 17 00:00:00 2001
From: Uwe Hermann <uwe@hermann-uwe.de>
Date: Sun, 12 Oct 2014 14:58:25 +0200
Subject: am230x: Change option to 'device' to allow for more devices.

---
 decoders/am230x/pd.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'decoders/am230x')

diff --git a/decoders/am230x/pd.py b/decoders/am230x/pd.py
index 9a783b9..02f8af2 100644
--- a/decoders/am230x/pd.py
+++ b/decoders/am230x/pd.py
@@ -47,8 +47,8 @@ class Decoder(srd.Decoder):
         {'id': 'sda', 'name': 'SDA', 'desc': 'Single wire serial data line'},
     )
     options = (
-        {'id': 'dht11', 'desc': 'DHT11 compatibility mode',
-            'default': 'no', 'values': ('no', 'yes')},
+        {'id': 'device', 'desc': 'Device type',
+            'default': 'am230x', 'values': ('am230x', 'dht11')},
     )
     annotations = (
         ('start', 'Start'),
@@ -101,7 +101,7 @@ class Decoder(srd.Decoder):
 
     def calculate_humidity(self, bitlist):
         h = 0
-        if self.options['dht11'] == 'yes':
+        if self.options['device'] == 'dht11':
             h = self.bits2num(bitlist[0:8])
         else:
             h = self.bits2num(bitlist) / 10
@@ -109,7 +109,7 @@ class Decoder(srd.Decoder):
 
     def calculate_temperature(self, bitlist):
         t = 0
-        if self.options['dht11'] == 'yes':
+        if self.options['device'] == 'dht11':
             t = self.bits2num(bitlist[0:8])
         else:
             t = self.bits2num(bitlist[1:]) / 10
-- 
cgit v1.2.3-70-g09d2