2.2 KiB
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:FireCheckHasResultFireCheckLastNumber
- 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:nullbefore any fire_check result is received; - prints
person:null,temp:null, andthreshold value:nullwhen fire_leave is disabled; - keeps
person/temp/thresholdonly when fire_leave is active; - adds
fire_candidate,fire_last_seen_age, andfire_leave_enabled.
- prints
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