diff --git a/action_devices.py b/action_devices.py index f4a0d9b..4fbed36 100644 --- a/action_devices.py +++ b/action_devices.py @@ -4,6 +4,7 @@ import json import logging import requests +import secrets from flask import current_app from notifications import mqtt @@ -316,8 +317,8 @@ def report_state(): if not REPORTSTATE_AVAILABLE: logger.warning("ReportState module not available, skipping report_state") return "ReportState not available" - import random - n = random.randint(10**19, 10**20) + + n = 10**19 + secrets.randbelow(9 * 10**19 + 1) report_state_file = { 'requestId': str(n), 'agentUserId': current_app.config['AGENT_USER_ID'],