Skip to content

Make uptime sensor human-readable - #72

Open
kernelpanic85 wants to merge 2 commits into
ApolloAutomation:mainfrom
kernelpanic85:patch-1
Open

kernelpanic85 wants to merge 2 commits into
ApolloAutomation:mainfrom
kernelpanic85:patch-1

Conversation

@kernelpanic85

@kernelpanic85 kernelpanic85 commented Sep 19, 2026 •

Copy link
Copy Markdown

Version: 26.3.2.1

What does this implement/fix?

Updates the R-PRO-1 uptime reporting to display uptime in days, hours, minutes, and seconds format instead of raw seconds.

Note: Might want to consider pushing this out to other devices if they all have the same uptime config currently.

Types of changes

  • Bugfix (fixed change that fixes an issue)
  • New feature (thanks!)
  • Breaking change (repair/feature that breaks existing functionality)
  • Dependency Update - Does not publish
  • Other - Does not publish
  • Website of github readme file update - Does not publish
  • Github workflows - Does not publish

Checklist / Checklijst:

  • The code change has been tested and works locally
  • The code change has not yet been tested

If user-visible functionality or configuration variables are added/modified:

  • Added/updated documentation for the web page

Summary by CodeRabbit

  • New Features

    • Added a formatted uptime display showing days, hours, minutes, and seconds.
    • Uptime formatting omits zero-valued units and uses concise labels, such as “1h 2m 3s.”
  • Changes

    • Uptime now refreshes when the underlying value changes rather than on a fixed 60-second polling interval.

Updates the R-PRO-1 uptime reporting to display uptime in days, hours, minutes, and seconds format instead of raw seconds.
@coderabbitai

coderabbitai Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: b056c6aa-53d4-4c5e-b344-37a9e7e0fc77

📥 Commits

Reviewing files that changed from the base of the PR and between 927380b and 417526e.

📒 Files selected for processing (1)
  • Integrations/ESPHome/Core.yaml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The ESPHome configuration now formats uptime in the raw-value callback. The sys_uptime text sensor receives published updates and no longer polls or formats uptime independently.

Changes

Uptime display

Layer / File(s) Summary
Internal uptime and formatted text
Integrations/ESPHome/Core.yaml
The uptime sensor formats raw seconds as unpadded days, hours, minutes, and seconds. It omits zero-valued larger units and publishes the result to sys_uptime. The text sensor uses update_interval: never.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: the uptime sensor now displays human-readable uptime values.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit watches seconds flow
Raw values shape the words we know
Zero units hop away
The text sensor waits each day
“1h 2m 3s,” we say

Comment @coderabbitai help to get the list of available commands.

Refactored uptime calculation logic to use on_raw_value event and removed previous lambda implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant