From: Uwe Hermann Date: Sun, 12 Oct 2014 12:58:25 +0000 (+0200) Subject: am230x: Change option to 'device' to allow for more devices. X-Git-Tag: libsigrokdecode-0.4.0~164 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=commitdiff_plain;h=cda1352a7ce0248e6db1996d9ddb9dbee2f91e8b;hp=f87162978a3f804d43ae12208c3d6a4a86382c1c am230x: Change option to 'device' to allow for more devices. --- 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