#!/bin/sh
# Extract CSV and PNG from JSON download format, for each of temp and humi.
# Assumes exactly one sensor's data (temp or humi) is present.

# Usage:
#     $0 ID
#         ID is the sensor ID and should match the data content
ID="$1"
if [ "" = "$ID" ]; then
    echo "ERROR: missing ID" 1>&2
    exit 1
fi

sh code/extractCSVfromJSON.sh "$ID"
sh code/plotTandRH.sh "$ID"

exit 0
