Files
fire_leave_tool/docs/2026-07-05_2240_global_status_log_fix.md

2.2 KiB

2026-07-05 22:40 Global Status Log Fix

Problem

In fire_check-only mode, the global status monitor still printed values like:

person:1 | temp:0.0°C | threshold value:70.0°C

Those fields belong to fire_leave/thermometry logic. When thermometry startup fails and fire_leave is disabled, these values are not active runtime measurements and should not be shown as real current data.

Change

  • Added latest fire_check result state in main.go:
    • FireCheckHasResult
    • FireCheckLastNumber
  • Updated the fire_check result branch to record the latest detected fire target count.
  • Updated printGlobalDeviceStatus():
    • prints fire:<value> for fire_check target count;
    • prints fire:null before any fire_check result is received;
    • prints person:null, temp:null, and threshold value:null when fire_leave is disabled;
    • keeps person/temp/threshold only when fire_leave is active;
    • adds fire_candidate, fire_last_seen_age, and fire_leave_enabled.

Expected Logs

Before any fire_check inference result is received:

[1] DeviceUUID=xxx | fire:null | fire_candidate:false | fire_last_seen_age:null | fire_leave_enabled:false | person:null | temp:null | threshold value:null | cooling time:0s

After fire_check reports one fire target:

[1] DeviceUUID=xxx | fire:1 | fire_candidate:true | fire_last_seen_age:500ms | fire_leave_enabled:false | person:null | temp:null | threshold value:null | cooling time:0s

If fire_check has reported a result but no fire target is present:

[1] DeviceUUID=xxx | fire:0 | fire_candidate:false | fire_last_seen_age:null | fire_leave_enabled:false | person:null | temp:null | threshold value:null | cooling time:0s

Impact

  • Does not change fire_check alarm upload/report logic.
  • Does not change heartbeat JSON format.
  • Does not change inference startup arguments.
  • Only changes runtime state tracking and global monitor log output.
  • fire_leave logs remain available when fire_leave and thermometry are active.

Verification

gofmt -w main.go
go test ./...
go build -o bin/fireleave_tool.new .

The new binary was installed as:

bin/fireleave_tool