Server-driven temperature thresholds + hide unused Board card#4
Merged
Conversation
…h) + hide unused Board card - policy.py: hoist safety thresholds to named constants (HOT_DRIVE_C/HOT_CPU_C/ RECOVER_*) + a THRESHOLDS map covering display-only warm/hot tiers for every sensor. evaluate() now references the constants instead of inline 44/70/40/60. - service.py: attach thresholds to every published /status snapshot. - server.py: propagate agent thresholds through core to the browser. - dashboard.js: colour temps from server-supplied thresholds (tier() helper); drop the duplicated hardcoded 61,70/41,44 literals. Falls back to defaults if an older agent omits them. #2: data-optional cards (Board) hide when their source reports null instead of showing a dead placeholder. - tests: +3 (threshold propagation through /status; anti-drift guarantee that display thresholds equal the safety constants the policy trips on).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor per Ace request (#1 + #2 from the dashboard review).
What
truefan_control/policy.pyowns named constants (HOT_DRIVE_C, HOT_CPU_C, RECOVER_*) + a THRESHOLDS map (incl. display-only warm/hot tiers for board/nvme)./statuscarries them; the frontend colours from them; per-device ranges preserved.--°. Nowdata-optionalcards hide when their source reports null.Safety
No change to actual thresholds or fan behaviour — pure de-duplication. The policy trips at exactly the same numbers (locked by a new anti-drift test).
Tests
49 passed (46 existing + 3 new): threshold propagation through /status, and an anti-drift guarantee that display thresholds equal the safety constants the policy trips on. JS syntax-checked with node --check.