Skip to content
Snippets Groups Projects
Commit 5f17ff8c authored by Callum Inglis's avatar Callum Inglis
Browse files

create secrets.py

parent 8f761057
No related branches found
No related tags found
3 merge requests!4Api authentication,!3Api authentication,!2Api authentication
This commit is part of merge request !4. Comments created here will be created in the context of that merge request.
...@@ -46,6 +46,8 @@ from SX127x.LoRaArgumentParser import LoRaArgumentParser ...@@ -46,6 +46,8 @@ from SX127x.LoRaArgumentParser import LoRaArgumentParser
from SX127x.board_config import BOARD from SX127x.board_config import BOARD
import SX127x.packer as packer import SX127x.packer as packer
import secrets
DEBUG = 1 DEBUG = 1
API_URL = "https://emiei.4oh4.co/api" API_URL = "https://emiei.4oh4.co/api"
MAX_TX_RESERVATION_TIME = 2 # Seconds MAX_TX_RESERVATION_TIME = 2 # Seconds
...@@ -72,6 +74,7 @@ class RxHello(object): ...@@ -72,6 +74,7 @@ class RxHello(object):
class SensorResponse(object): class SensorResponse(object):
def __init__(self, sensorMetadata, data): def __init__(self, sensorMetadata, data):
self.gateway = Gateway()
self.sensorMetadata = SensorMetadata(**sensorMetadata) self.sensorMetadata = SensorMetadata(**sensorMetadata)
self.sensorReading = SensorReading(**data) self.sensorReading = SensorReading(**data)
...@@ -86,6 +89,11 @@ class SensorResponse(object): ...@@ -86,6 +89,11 @@ class SensorResponse(object):
print(response) # Ensure 200 Response! print(response) # Ensure 200 Response!
return return
class Gateway(object):
def __init__(self):
self.gatewayUID = getserial()
self.apiKey = secrets.API_KEY
class SensorMetadata(object): class SensorMetadata(object):
def __init__(self, uid, messageID, samplePeriod): def __init__(self, uid, messageID, samplePeriod):
self.uid = uid self.uid = uid
......
API_KEY = "<API KEY HERE>"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment