nieuwe jwt token
This commit is contained in:
parent
6b3b1217ae
commit
fa75a6b218
3 changed files with 8 additions and 5 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
||||||
.venv/
|
.venv/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
src/backups/
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ from datetime import datetime
|
||||||
from collections import deque
|
from collections import deque
|
||||||
|
|
||||||
##### Mqtt vars #####
|
##### Mqtt vars #####
|
||||||
broker_address = "192.168.1.250"
|
broker_address = "192.168.1.160"
|
||||||
broker_port = 1883
|
broker_port = 1883
|
||||||
recieve_topic = "telegrambot/in/glucose/gj"
|
recieve_topic = "telegrambot/in/glucose/gj"
|
||||||
send_topic = "telegrambot/out/gj"
|
send_topic = "telegrambot/out/gj"
|
||||||
|
|
@ -14,11 +14,12 @@ brokercreds = ["hass","Bruk#5"]
|
||||||
##### Variables #####
|
##### Variables #####
|
||||||
|
|
||||||
# API JWT token, Account-Id and Patient_Id
|
# API JWT token, Account-Id and Patient_Id
|
||||||
jwt_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImM1ZGVhZGZiLTNlZDYtMTFlYS1hZjZmLTAyNDJhYzExMDAwYSIsImZpcnN0TmFtZSI6IkdlcnRqYW4iLCJsYXN0TmFtZSI6Iktvb2xlbiIsImNvdW50cnkiOiJOTCIsInJlZ2lvbiI6ImV1Iiwicm9sZSI6InBhdGllbnQiLCJzIjoibGx1LmFuZHJvaWQiLCJzaWQiOiIxNjE5NmZkMy1mMmEzLTQ0MWMtOGEwZi03Y2Y2YjAyODQwZjYiLCJleHAiOjE3Njk1ODY1NjgsImlhdCI6MTc1NDAzNDU2OCwianRpIjoiNWQwZjI4NTctZmI2My00ZDlhLWE4MDAtZjVhNWNhMjg4MzZiIn0.4GupiVfdhIlavbMTTNQcy8UMeAvwnsSzdmfvQMVcoV8"
|
jwt_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImM1ZGVhZGZiLTNlZDYtMTFlYS1hZjZmLTAyNDJhYzExMDAwYSIsImZpcnN0TmFtZSI6IkdlcnRqYW4iLCJsYXN0TmFtZSI6Iktvb2xlbiIsImNvdW50cnkiOiJOTCIsInJlZ2lvbiI6ImV1Iiwicm9sZSI6InBhdGllbnQiLCJlbWFpbCI6Imdqa29vbGVuQGdtYWlsLmNvbSIsInMiOiJsbHUuYW5kcm9pZCIsInNpZCI6IjkzYTZmMmU2LWRjNDQtNDA0Mi04YjBiLTcxMGQ3MzAyMzMyNSIsInRhc2tUeXBlIjoidG91IiwiZXhwIjoxNzYwMTkzMDM2LCJpYXQiOjE3NjAxODk0MzYsImp0aSI6ImU0NTRlYzljLTE2ZTMtNDQwMy05YjYyLTc0NjAxZTkzNDFjOSJ9.hiyrVjE2kWvBr2DjtPojdTDtkqNrPI57HubXYl4Kko0"
|
||||||
Account_ID = "dad20d62aeef891d94bda411af269900180cb7b84a0ce51d60b52463339935b1"
|
Account_ID = "dad20d62aeef891d94bda411af269900180cb7b84a0ce51d60b52463339935b1"
|
||||||
Patient_ID = "c5deadfb-3ed6-11ea-af6f-0242ac11000a"
|
Patient_ID = "c5deadfb-3ed6-11ea-af6f-0242ac11000a"
|
||||||
# API endpoint for login
|
# API endpoint for login
|
||||||
url = f"https://api-eu.libreview.io/llu/connections/{Patient_ID}/graph"
|
#url = f"https://api-eu.libreview.io/llu/connections/{Patient_ID}/graph"
|
||||||
|
url = f"https://libreview-proxy.onrender.com/eu/auth/continue/tou"
|
||||||
|
|
||||||
# Headers
|
# Headers
|
||||||
headers = {
|
headers = {
|
||||||
|
|
@ -75,6 +76,7 @@ def main(url_main, headers_main):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
# Send the Get request
|
# Send the Get request
|
||||||
|
print(f"connecting to Libreview server, address: {url_main} with headers {headers_main}")
|
||||||
response = requests.get(url_main, headers=headers_main) # json=payload
|
response = requests.get(url_main, headers=headers_main) # json=payload
|
||||||
if response.status_code == 200: # If request has succeeded
|
if response.status_code == 200: # If request has succeeded
|
||||||
data = response.json()
|
data = response.json()
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import paho.mqtt.client as mqtt
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
##### Mqtt vars #####
|
##### Mqtt vars #####
|
||||||
broker_address = "192.168.1.250"
|
broker_address = "192.168.1.160"
|
||||||
broker_port = 1883
|
broker_port = 1883
|
||||||
recieve_topic = "telegrambot/out/#"
|
recieve_topic = "telegrambot/out/#"
|
||||||
send_topic_server = "telegrambot/in/server/"
|
send_topic_server = "telegrambot/in/server/"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue