Skip to content

Commit

Permalink
removed some redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
ccall48 committed Sep 25, 2023
1 parent 70309ad commit 820de4b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 28 deletions.
28 changes: 0 additions & 28 deletions app/ChirpHeliumRequests.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,31 +376,3 @@ def stream_meta(self):
print(f'stream_meta: {err}')
pass

# def gw_stream_frame(self):
# stream_key = 'gw:stream:frame'
# last_id = '0'
# try:
# while True:
# resp = rdb.xread({stream_key: last_id}, count=1, block=0)
#
# for message in resp[0][1]:
# last_id = message[0]
#
# if b"up" in message[1]:
# b = message[1][b"up"]
# pl = api.frame_log_pb2.UplinkFrameLog()
# pl.ParseFromString(b)
# print("==========[UPLINK Gateway FRAME message...]==========")
# print(MessageToJson(pl))
# # client.publish("gateway/frame/up", MessageToJson(pl))
#
# if b"down" in message[1]:
# b = message[1][b"down"]
# pl = api.frame_log_pb2.DownlinkFrameLog()
# pl.ParseFromString(b)
# print("==========[DOWNLINK Gateway FRAME message...]==========")
# print(MessageToJson(pl))
# # client.publish("gateway/frame/down", MessageToJson(pl))
# except Exception as err:
# print(f'gw_stream_frame: {err}')
# pass
2 changes: 2 additions & 0 deletions app/ChirpHeliumTenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def meta_up(self, data: dict):
query = """
UPDATE helium_devices SET dc_used = (dc_used + {}) WHERE dev_eui='{}';
""".format(total_dc, dev_eui)
print(f'UPLINK DC USED: {query}')
self.db_transaction(query)
return

Expand All @@ -94,6 +95,7 @@ def meta_down(self, data: dict):
query = """
UPDATE helium_devices SET dc_used = (dc_used + {}) WHERE dev_eui='{}';
""".format(total_dc, dev_eui)
print(f'DOWNLINK DC USED: {query}')
self.db_transaction(query)
return

Expand Down
9 changes: 9 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
aiohttp==3.8.5
aiomqtt==1.1.0
aiosignal==1.3.1
aiosqlite==0.19.0
async-timeout==4.0.3
asyncio-mqtt==0.16.2
asyncpg==0.28.0
attrs==23.1.0
base58==2.1.1
cachetools==5.3.1
certifi==2023.5.7
cffi==1.15.1
charset-normalizer==3.2.0
chirpstack-api==4.4.0
frozenlist==1.4.0
google-api-core==2.11.1
google-auth==2.21.0
googleapis-common-protos==1.59.1
grpcio==1.56.0
grpcio-tools==1.56.0
idna==3.4
multidict==6.0.4
paho-mqtt==1.6.1
protobuf==4.23.4
psycopg2-binary==2.9.6
Expand All @@ -26,3 +33,5 @@ rsa==4.9
six==1.16.0
ujson==5.8.0
urllib3==1.26.16
xxhash==3.3.0
yarl==1.9.2

0 comments on commit 820de4b

Please sign in to comment.