#!/usr/bin/python3
import requests
import json

h = { "api-secret": "478f54aa9791d3b9e1ff63cc0fbb67c945cba822" }
r = requests.get("http://10.0.0.235:17580/sgv.json", headers=h)

# Testing locally with file
#f = open('sgv.json')
#data = json.load(f)
data = r.json()

sgv = data[0]["sgv"]
delta = data[0]["delta"]

if (delta > 0):
    trend = "↑"
elif (delta < 0):
    trend = "↓"

print("", str(sgv) + trend)
