diff --git a/app/ChirpHeliumCrypto.py b/app/ChirpHeliumCrypto.py index 32e5ae5..4b37b67 100644 --- a/app/ChirpHeliumCrypto.py +++ b/app/ChirpHeliumCrypto.py @@ -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)) @@ -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()) ########################################################################### diff --git a/app/ChirpHeliumTenant.py b/app/ChirpHeliumTenant.py index 872bb9c..d775763 100644 --- a/app/ChirpHeliumTenant.py +++ b/app/ChirpHeliumTenant.py @@ -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