cloud_discovery: Skip rewriting discovery.state.json when no discovery metho d is set

In cases where gateway.json exists, the discovery method may be unset.
Writing an empty value to discovery.state.json is not useful, so
avoid updating the file in this case.

Signed-off-by: Marek Kwaczynski <marek@shasta.cloud>
This commit is contained in:
Marek Kwaczynski
2025-09-18 10:40:21 +02:00
committed by John Crispin
parent 957e3ca997
commit ed57759824

View File

@@ -102,6 +102,9 @@ function gateway_load() {
}
function discovery_state_write() {
if (length(discovery_method) == 0)
return;
let discovery_state = {
"type": discovery_method,
"updated": time()