|
|
|
|
@ -56,22 +56,11 @@ def is_model_config_key(key, value):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_required_drone_streak(freq):
|
|
|
|
|
raw_value = config.get(f"DRONE_STREAK_{freq}", "1")
|
|
|
|
|
try:
|
|
|
|
|
return max(1, int(raw_value))
|
|
|
|
|
except (TypeError, ValueError):
|
|
|
|
|
logging.warning("Invalid DRONE_STREAK_%s=%r, falling back to 1", freq, raw_value)
|
|
|
|
|
return 1
|
|
|
|
|
return config.get(f"DRONE_STREAK_{freq}", "1")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_required_drone_prob(freq):
|
|
|
|
|
raw_value = config.get(f"DRONE_PROB_THRESHOLD_{freq}", config.get("DRONE_PROB_THRESHOLD_DEFAULT", "0"))
|
|
|
|
|
try:
|
|
|
|
|
value = float(raw_value)
|
|
|
|
|
return min(1.0, max(0.0, value))
|
|
|
|
|
except (TypeError, ValueError):
|
|
|
|
|
logging.warning("Invalid DRONE_PROB_THRESHOLD for %s=%r, falling back to 0.0", freq, raw_value)
|
|
|
|
|
return 0.0
|
|
|
|
|
return config.get(f"DRONE_PROB_THRESHOLD_{freq}", config.get("DRONE_PROB_THRESHOLD_DEFAULT", "0"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def update_drone_streak(freq, prediction, drone_probability):
|
|
|
|
|
@ -197,6 +186,7 @@ def receive_data():
|
|
|
|
|
result = update_drone_streak(freq, prediction, drone_probability)
|
|
|
|
|
data_to_send={
|
|
|
|
|
'freq': str(freq),
|
|
|
|
|
#'channel': int(data['channel']),
|
|
|
|
|
'amplitude': result
|
|
|
|
|
#'triggered': False if result < 7 else True,
|
|
|
|
|
#'light_len': result
|
|
|
|
|
|