Repository navigation
Report NTP the same way in the header badge as in the Services tile - #1327
Merged
Merged
Conversation
The Services badge counted NTP as OK as soon as the clock was set, while the Services tile and the MQTT services announcement report it as connecting until the first SNTP sync and again when no sync has succeeded for 3 hours. The badge could be green while the tile showed NTP yellow. Move the tile's rule into AmsJsonGenerator::ntpState() and use it for both, like hanState() and mqttHandlerState(). Co-Authored-By: Claude Opus 5.5 <[email protected]>
🔧 PR Build ArtifactsVersion: All environments built successfully. Download the zip files:
|
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.
Why
The two places that show NTP status use different rules:
data.jsonsa, fromAmsWebServer::computeServicesAggregate()): NTP counts as OK as soon as the clock is later than the build time.AmsJsonGenerator::generateServicesJson()): NTP is "connecting" until the first SNTP sync after boot, and again when no sync has succeeded for 3 hours (Track last SNTP sync time to flag a stale clock on the Services tile #1221).So the badge could be green while the tile it links to showed NTP yellow.
Changes
AmsJsonGenerator::ntpState(), next tohanState()andmqttHandlerState(), and use it in both places.Verification
pio runfor esp8266dev, esp32dev and esp32s2dev.pio test -e nativepasses.🤖 Generated with Claude Code