Template - Bitcoin price change in last hour

Started by SasaKaranovic, Mar 10, 2024, 09:26 PM

Previous topic - Next topic

SasaKaranovic

This API Link will pull bitcoin price change in the last hour, scale it to +-5% and display it on your VU Dial
The price is pulled from public API (api.coinlore.net)

Link image attached

Link contents

[info]
name = "Bitcoin price change tracker"
file = "requests_bitcoin_hourly_price_change.toml"
image = "bitcoin_5.png"
description = "Retrive Bitcoin price change in the last 1hr (in percent)"
driver = "requests"
enabled = true

[api]
url = "https://api.coinlore.net/api/ticker/?id=90"
item = "response[0]['percent_change_1h']"
update_period = 600
headers = []
value_modifiers = [
    { function = "scale_number", min=-5, max=5 },
]

[dial]
uid = "__REPLACE_WIT_YOUR_DIAL_UID__"
host = "localhost"
port = 5340
api_key = "cTpAWYuRpA2zx75Yh961Cg"

[backlight_map]
0 = [20, 0, 0]
46 = [10, 0, 0]
47 = [2, 0, 0]
48 = [10, 10, 10]
52 = [0, 10, 0]
55 = [0, 20, 0]