Skip to content

Commit

Permalink
Merge pull request #66 from ccall48/patch/second-precison
Browse files Browse the repository at this point in the history
Patch/second precison
  • Loading branch information
ccall48 authored Apr 20, 2024
2 parents 451b6d1 + 4a2829c commit 895f70f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/ChirpHeliumCrypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# precision for signing rpc's moving from milliseconds to seconds in next iot config update
# quick helper function to switch it over quickly when updated.
PRECISION = 'ms'
PRECISION = 's'

host = os.getenv("HELIUM_HOST", default="mainnet-config.helium.io")
port = int(os.getenv("HELIUM_PORT", default=6080))
Expand Down Expand Up @@ -52,7 +52,8 @@ def wrapper(*args, **kwargs):
def rpc_time(precision: str = None):
if precision == 'ms':
return int(datetime.utcnow().timestamp()*1000)
return int(datetime.utcnow().timestamp())
elif precision == 's':
return int(datetime.utcnow().timestamp())


###########################################################################
Expand Down
2 changes: 1 addition & 1 deletion app/ChirpHeliumTenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def meta_up(self, data: dict):
""".format(total_dc, dev_eui)
self.db_transaction(query)

if os.getenv('PUBLISH_USAGE_EVENTS'):
if os.getenv('PUBLISH_USAGE_EVENTS') == 'True':
# First we get the tenant id for the device...
query = """
SELECT application.tenant_id, application.id FROM application
Expand Down

0 comments on commit 895f70f

Please sign in to comment.