- resp_1 = requests.post("https://api.luftdaten.info/v1/push-sensor-data/",
- json={
- "software_version": "enviro-plus 0.0.1",
- "sensordatavalues": [{"value_type": key, "value": val} for
- key, val in pm_values.items()]
- },
- headers={
- "X-PIN": "1",
- "X-Sensor": id,
- "Content-Type": "application/json",
- "cache-control": "no-cache"
- }
+ pm_values_json = [{"value_type": key, "value": val} for key, val in pm_values.items()]
+ temp_values_json = [{"value_type": key, "value": val} for key, val in temp_values.items()]
+
+ resp_1 = requests.post(
+ "https://api.luftdaten.info/v1/push-sensor-data/",
+ json={
+ "software_version": "enviro-plus 0.0.1",
+ "sensordatavalues": pm_values_json
+ },
+ headers={
+ "X-PIN": "1",
+ "X-Sensor": id,
+ "Content-Type": "application/json",
+ "cache-control": "no-cache"
+ }