From 4a8b2474b8ab95eb58167e37ef93a6adcae51fdf Mon Sep 17 00:00:00 2001 From: sessionm21 Date: Tue, 12 May 2020 22:11:33 +0100 Subject: [PATCH] move keys to config file --- config.ini | 3 +++ main.py | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 config.ini diff --git a/config.ini b/config.ini new file mode 100644 index 0000000..46661bf --- /dev/null +++ b/config.ini @@ -0,0 +1,3 @@ +[Default] +AppId=app_id +AccessKey=ttn-account-v2.redacted diff --git a/main.py b/main.py index 342b1a7..6836bc7 100644 --- a/main.py +++ b/main.py @@ -4,9 +4,12 @@ import base64 import message_pb2 import sqlite3 -app_id = "fenceles_grazing" -access_key = "ttn-account-v2.XVvtBVcWzkeby-fe9eLtiJBLRbjQR-b358S4z70Xa-0" +import configparser +config = configparser.ConfigParser() +config.read("config.ini") +app_id = config['Default']['AppId'] +access_key = config['Default']['AccessKey'] # For now use collar id of 1, should look up collar id based on collarname from db def store_coord(collarname, x, y):