Skip to content

Commit 70fe459

Browse files
committed
Found bug in the decoder
1 parent 336612d commit 70fe459

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setuptools.setup(
88
name="cuplcodec",
9-
version="1",
9+
version="1.0.1",
1010
author="Malcolm Mackay",
1111
author_email="malcolm@plotsensor.com",
1212
description="Package for creating and decoding URLs that contain temperature and humidity samples.",

wscodec/decoder/hdc2021.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,13 @@ def __init__(self, *args, **kwargs):
4545
temperature (degrees C) and relative humidity (%) readings.
4646
"""
4747
super().__init__(*args, **kwargs)
48+
timestamp_gen = self.generate_timestamp()
4849

4950
for pair in self.pairs:
5051
temp = pair.rd0
5152
rh = pair.rd1
5253

53-
sample = TempRHSample(temp, rh, timestamp=self.generate_timestamp())
54+
sample = TempRHSample(temp, rh, timestamp=next(timestamp_gen))
5455
self.samples.append(sample)
5556

5657

@@ -62,11 +63,12 @@ def __init__(self, *args, **kwargs):
6263
temperature reading in degrees C.
6364
"""
6465
super().__init__(*args, **kwargs)
66+
timestamp_gen = self.generate_timestamp()
6567

6668
for pair in self.pairs:
6769
if pair.rd1 != 4095:
6870
sample = TempSample(pair.rd1)
6971
self.samples.append(sample)
7072

71-
sample = TempSample(pair.rd0, timestamp=self.generate_timestamp())
73+
sample = TempSample(pair.rd0, timestamp=next(timestamp_gen))
7274
self.samples.append(sample)

0 commit comments

Comments
 (0)