Skip to content

Fix LTR390 interval lambda: handle NAN state, remove boot timing guard#63

Merged
bharvey88 merged 1 commit intobetafrom
fix-ltr390-interval-lambda
Mar 3, 2026
Merged

Fix LTR390 interval lambda: handle NAN state, remove boot timing guard#63
bharvey88 merged 1 commit intobetafrom
fix-ltr390-interval-lambda

Conversation

@bharvey88
Copy link
Contributor

Version: 26.3.2.1

What does this implement/fix?

Fixes two issues in the LTR390 interval lambda introduced in #56:

  • NAN cast: (uint32_t)id(ltr390_update_interval).state is undefined behavior when the template number hasn't initialized yet (state is NAN). Replaced with a ternary that falls back to 60s when the value is not >= 1.0f — NAN comparisons return false so this handles both cases.
  • Boot timing guard: last_update == 0 && current_time > 0 prevented the immediate boot update from firing in the first second (millis() / 1000 == 0). Removed current_time > 0 so the update fires on the first tick whenever last_update == 0.

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

@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

Warning

Rate limit exceeded

@bharvey88 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 14 minutes and 15 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 0a5b139 and a6d74c1.

📒 Files selected for processing (1)
  • Integrations/ESPHome/Core.yaml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-ltr390-interval-lambda

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.

@github-actions github-actions bot requested a review from TrevorSchirmer March 2, 2026 21:07
@github-actions github-actions bot added the bugfix Bug fix label Mar 2, 2026
@bharvey88 bharvey88 merged commit c04f0f2 into beta Mar 3, 2026
12 checks passed
@bharvey88 bharvey88 deleted the fix-ltr390-interval-lambda branch March 3, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants