]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/am230x/pd.py
All PDs: Consistently use singular/plural for annotation classes/rows.
[libsigrokdecode.git] / decoders / am230x / pd.py
index 0e4eac85223e94d3f65414ab5f320f8d220ca6ec..eedf9428e70595b6e2680e03aa2cf430b237518c 100644 (file)
@@ -36,12 +36,13 @@ class SamplerateError(Exception):
 class Decoder(srd.Decoder):
     api_version = 3
     id = 'am230x'
-    name = 'AM230x/DHTxx/RHTxx'
+    name = 'AM230x'
     longname = 'Aosong AM230x/DHTxx/RHTxx'
-    desc = 'Aosong AM230x/DHTxx/RHTxx humidity/temperature sensor protocol.'
+    desc = 'Aosong AM230x/DHTxx/RHTxx humidity/temperature sensor.'
     license = 'gplv2+'
     inputs = ['logic']
-    outputs = ['am230x']
+    outputs = []
+    tags = ['IC', 'Sensor']
     channels = (
         {'id': 'sda', 'name': 'SDA', 'desc': 'Single wire serial data line'},
     )
@@ -55,8 +56,8 @@ class Decoder(srd.Decoder):
         ('bit', 'Bit'),
         ('end', 'End'),
         ('byte', 'Byte'),
-        ('humidity', 'Relative humidity in percent'),
-        ('temperature', 'Temperature in degrees Celsius'),
+        ('humidity', 'Relative humidity'),
+        ('temperature', 'Temperature'),
         ('checksum', 'Checksum'),
     )
     annotation_rows = (
@@ -122,6 +123,9 @@ class Decoder(srd.Decoder):
         return checksum % 256
 
     def __init__(self):
+        self.reset()
+
+    def reset(self):
         self.samplerate = None
         self.reset_variables()