X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fmlx90614%2Fpd.py;h=67a852c4b9c7854c1a7bb1ba15f0b866f4872b09;hb=f2a5df42ea41e6c4370d4efa1a27ab942ba1ddff;hp=1ee88d78509bad088f36254e1c4ab5b778beb350;hpb=24c74fd30fb161837c5f8b01baf3c0fe2dfa4ed5;p=libsigrokdecode.git diff --git a/decoders/mlx90614/pd.py b/decoders/mlx90614/pd.py index 1ee88d7..67a852c 100644 --- a/decoders/mlx90614/pd.py +++ b/decoders/mlx90614/pd.py @@ -1,5 +1,5 @@ ## -## This file is part of the sigrok project. +## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2012 Uwe Hermann ## @@ -36,15 +36,15 @@ class Decoder(srd.Decoder): options = {} annotations = [ ['Celsius', 'Temperature in degrees Celsius'], - ['Kelvin', 'Temperature in degrees Kelvin'], + ['Kelvin', 'Temperature in Kelvin'], ] def __init__(self, **kwargs): self.state = 'IGNORE START REPEAT' self.data = [] - def start(self, metadata): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'mlx90614') + def start(self): + # self.out_proto = self.add(srd.OUTPUT_PYTHON, 'mlx90614') self.out_ann = self.add(srd.OUTPUT_ANN, 'mlx90614') def report(self): @@ -79,9 +79,9 @@ class Decoder(srd.Decoder): kelvin = (self.data[0] | (self.data[1] << 8)) * 0.02 celsius = kelvin - 273.15 self.putx([0, ['Temperature: %3.2f °C' % celsius]]) - self.putx([1, ['Temperature: %3.2f °K' % kelvin]]) + self.putx([1, ['Temperature: %3.2f K' % kelvin]]) self.state = 'IGNORE START REPEAT' self.data = [] else: - raise Exception('Invalid state: %d' % self.state) + raise Exception('Invalid state: %s' % self.state)