Commit fa3406c6c2b83d50449d1a172c2e9e144b024938

Authored by Greg Sandstrom
1 parent 6d91bc14cd
Exists in main

write tc08 device serial as tag to measurements

Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff

temperature_logger.py View file @ fa3406c
... ... @@ -73,6 +73,7 @@
73 73 for reading in data[channel]:
74 74 (temperature, time_ms, overflow) = reading
75 75 point = self.make_point(
  76 + serial,
76 77 channel,
77 78 temperature,
78 79 time_ms,
79 80  
... ... @@ -81,10 +82,10 @@
81 82 points.append(point)
82 83 self.idb.commit(points)
83 84  
84   - def make_point(self, channel, temperature, time_ms, overflow):
  85 + def make_point(self, serial, channel, temperature, time_ms, overflow):
85 86 json_body = {
86 87 "measurement": "temperature",
87   - "tags": {"channel": channel},
  88 + "tags": {"channel": channel, "tc08-serial": serial},
88 89 "time": time_ms,
89 90 "fields": {"temperature": temperature, "overflow": overflow},
90 91 }