Skip to content

Conversation

@sjpilot
Copy link

@sjpilot sjpilot commented Feb 9, 2026

check is not just 1970-01-01, it is 2019-01-01 or onwards per https://api-docs.esphome.io/time_8h_source#l00073

Description:

Related issue : fixes #6050

Pull request in esphome with YAML changes (if applicable):

  • esphome/esphome#

Checklist:

  • I am merging into next because this is new documentation that has a matching pull-request in esphome as linked above.
    or

  • I am merging into current because this is a fix, change and/or adjustment in the current documentation and is not for a new component or feature.

  • Link added in /components/_index.md when creating new documents for new components or cookbook.

check is not just 1970-01-01, it is 2019-01-01 or onwards per https://api-docs.esphome.io/time_8h_source#l00073
@esphome esphome bot added the current label Feb 9, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

Walkthrough

Documentation correction to the time component's is_valid() method description. Updated from "not January 1st 1970" to "year 2019 or newer" to accurately reflect the method's actual validation behavior, with corresponding updates to the surrounding guidance text.

Changes

Cohort / File(s) Summary
Time Component Documentation
content/components/time/_index.md
Corrected is_valid() description in both the has_time section and Use In Lambdas table to accurately state year 2019 or newer validation. Updated surrounding note to recommend checking validity before triggering actions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: updating time.is_valid() documentation to reflect the actual validation logic.
Description check ✅ Passed The description is directly related to the changeset, explaining the documentation correction from 1970-01-01 to 2019-01-01 with a reference to the implementation source.
Linked Issues check ✅ Passed The PR successfully addresses the objective in linked issue #6050 by updating the is_valid() documentation to correctly state the check is for 2019-01-01 or later, as specified in the implementation source.
Out of Scope Changes check ✅ Passed All changes are scoped to correcting the time.is_valid() documentation; no unrelated modifications or feature additions are present in this documentation fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
content/components/time/_index.md (1)

261-273: ⚠️ Potential issue | 🟡 Minor

Update the .year example to a 2019+ value to align with the .is_valid() threshold.

The table shows a .year example of 2018 while the .is_valid() description states it checks for "year 2019 or newer." This creates confusion—the example year would fail the validity check described in the same table. Update the .year example to 2019 or later to maintain consistency.

@netlify
Copy link

netlify bot commented Feb 9, 2026

Deploy Preview for esphome ready!

Name Link
🔨 Latest commit 4d945f5
🔍 Latest deploy log https://app.netlify.com/projects/esphome/deploys/6989be893b6c960008abdf23
😎 Deploy Preview https://deploy-preview-6051--esphome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@sjpilot
Copy link
Author

sjpilot commented Feb 9, 2026

😎 Deploy Preview https://deploy-preview-6051--esphome.netlify.app

New text looks good: https://deploy-preview-6051--esphome.netlify.app/components/time/

Basic check if the time is valid (i.e. year 2019 or newer) --

I don't understand what @coderabbitai is on about but if it helps maintainers ok and thanks for all your hard work.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

Tip

For best results, initiate chat on the files or code changes.

@sjpilot, thanks for verifying the deploy preview! The updated documentation correctly reflects the actual implementation behavior (year 2019 or newer), which is much more accurate than the previous text.

Your fix addresses a real documentation discrepancy and will help users understand what is_valid() actually checks for. The change looks good! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

time .is_valid() is not just a check for 1970-01-01

1 participant