refactor: clean up whitespace and improve formatting in emit_status_snapshot function
This commit is contained in:
@@ -40,7 +40,6 @@ def emit_status_snapshot():
|
|||||||
# --- Merge roster entries first ---
|
# --- Merge roster entries first ---
|
||||||
for unit_id, r in roster.items():
|
for unit_id, r in roster.items():
|
||||||
e = emitters.get(unit_id)
|
e = emitters.get(unit_id)
|
||||||
|
|
||||||
if r.retired:
|
if r.retired:
|
||||||
# Retired units get separated later
|
# Retired units get separated later
|
||||||
status = "Retired"
|
status = "Retired"
|
||||||
@@ -60,12 +59,12 @@ def emit_status_snapshot():
|
|||||||
age = "N/A"
|
age = "N/A"
|
||||||
fname = ""
|
fname = ""
|
||||||
|
|
||||||
units[unit_id] = {
|
units[unit_id] = {
|
||||||
"id": unit_id,
|
"id": unit_id,
|
||||||
"status": status,
|
"status": status,
|
||||||
"age": age,
|
"age": age,
|
||||||
"last": last_seen.isoformat() if last_seen else None,
|
"last": last_seen.isoformat() if last_seen else None,
|
||||||
"fname": fname,
|
"fname": fname,
|
||||||
"deployed": r.deployed,
|
"deployed": r.deployed,
|
||||||
"note": r.note or "",
|
"note": r.note or "",
|
||||||
"retired": r.retired,
|
"retired": r.retired,
|
||||||
@@ -76,12 +75,12 @@ def emit_status_snapshot():
|
|||||||
"deployed_with_modem_id": r.deployed_with_modem_id,
|
"deployed_with_modem_id": r.deployed_with_modem_id,
|
||||||
"ip_address": r.ip_address,
|
"ip_address": r.ip_address,
|
||||||
"phone_number": r.phone_number,
|
"phone_number": r.phone_number,
|
||||||
"hardware_model": r.hardware_model,
|
"hardware_model": r.hardware_model,
|
||||||
# Location for mapping
|
# Location for mapping
|
||||||
"location": r.location or "",
|
"location": r.location or "",
|
||||||
"address": r.address or "",
|
"address": r.address or "",
|
||||||
"coordinates": r.coordinates or "",
|
"coordinates": r.coordinates or "",
|
||||||
}
|
}
|
||||||
|
|
||||||
# --- Add unexpected emitter-only units ---
|
# --- Add unexpected emitter-only units ---
|
||||||
for unit_id, e in emitters.items():
|
for unit_id, e in emitters.items():
|
||||||
|
|||||||
Reference in New Issue
Block a user