Pass provider information to lower level

This commit is contained in:
Nico Schottelius 2016-11-27 20:26:14 +01:00
parent 7fa83bab31
commit cf4cd8cf40

View file

@ -76,12 +76,16 @@ def get_temp(deveui, payload):
return res return res
def decode_adeunis(pkg): def decode_adeunis(provider, pkg):
data = pkg.split(":") data = pkg.split(":")
deveui = data[0] deveui = data[0]
payload = data[1] payload = data[1]
# ttn -> base64 encoded
if provider == "ttn":
payload = base64.b64decode(payload)
res = [] res = []
# Only handle known devices # Only handle known devices
@ -94,11 +98,8 @@ def decode_adeunis(pkg):
return res return res
def nodered_adeunisrf(provider, data): def nodered_adeunisrf(provider, data):
# ttn -> base64 encoded res = decode_adeunis(provider, data)
if provider == "ttn":
data = base64.b64decode(data)
res = decode_adeunis(data)
if not res: if not res:
return return