Skip to content

Conversation

somebox
Copy link

@somebox somebox commented Sep 22, 2025

Description:

Improve documentation and clarity for the flicker effect.

I've always found the description and parameter docs a bit confusing. It mentions "forget-factor" and "amplitude" in the parameter descriptions, and doesn't mention that brightness AND color channels are affected.

After many years of head-scratching I decided to look at the code carefully, test different value combinations, and tried to write a better explanation. My hope is that this change would make it more clear to users how to configure and experiment with the flicker effect.

Related issue (if applicable): none

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

(none)

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.rst when creating new documents for new components or cookbook.

@Copilot Copilot AI review requested due to automatic review settings September 22, 2025 23:29
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Improves the documentation for the flicker light effect to provide clearer explanations of its behavior and parameters.

Key changes:

  • Replaces vague description with clear explanation of the effect's behavior on brightness and color channels
  • Clarifies the alpha parameter as a smoothing factor rather than "forget-factor"
  • Better explains the intensity parameter's impact on visual changes

@esphome esphome bot added the current label Sep 22, 2025
Copy link

netlify bot commented Sep 22, 2025

Deploy Preview for esphome ready!

Name Link
🔨 Latest commit ef76a01
🔍 Latest deploy log https://app.netlify.com/projects/esphome/deploys/68d4ab34aa2961000820be7f
😎 Deploy Preview https://deploy-preview-5392--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.

Copy link
Contributor

coderabbitai bot commented Sep 22, 2025

Walkthrough

Updated documentation in content/components/light/_index.md: revised the Flicker effect description and clarified configuration variable definitions for alpha (smoothing/memory) and intensity (per-step random change magnitude affecting all color channels).

Changes

Cohort / File(s) Summary
Docs: Light component — Flicker effect
content/components/light/_index.md
Revised Flicker Effect text to state random variations apply to brightness and all color channels around the active color; updated example config to include a named Flicker variant with alpha and intensity; reworded alpha as a smoothing/memory factor (default 95%) and intensity as per-step random change magnitude (default 1.5%).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly and accurately describes the primary change — improving the explanation of the flicker effect and its parameters — and directly matches the documentation edits in content/components/light/_index.md. It is concise, relevant, and gives a teammate scanning history a clear idea of the change's intent. There is no misleading or unrelated text in the title.
Description Check ✅ Passed The pull request description clearly explains the intent to improve documentation for the flicker effect, describes the author's investigation and testing, and references the chosen target branch and checklist, all of which align with the provided changeset. It is directly related to the modifications in the _index.md file and therefore satisfies this lenient check. The level of detail is sufficient for reviewers to understand why the documentation was changed.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c816e7c and 7842d56.

📒 Files selected for processing (1)
  • content/components/light/_index.md (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • content/components/light/_index.md

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
content/components/light/_index.md (1)

628-628: Tighten wording; avoid scare quotes and state mean behavior explicitly.

Suggest clearer phrasing and remove quotes around hover.

-This effect applies random variations to the brightness and all color channels which "hover" around the active color of the light. The default values simulate a gentle candle flicker, but with different settings it can produce gentle color shifts or chaotic sparkly noise.
+This effect applies small random variations to brightness and all color channels that hover around the current light color. Defaults simulate a gentle candle‑like flicker; higher settings can introduce subtle color shifts or more chaotic, sparkly noise.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2002df4 and c816e7c.

📒 Files selected for processing (1)
  • content/components/light/_index.md (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

  • Do not generate or add any sequence diagrams

Files:

  • content/components/light/_index.md
🔇 Additional comments (1)
content/components/light/_index.md (1)

646-647: Define recurrence and clarify intensity units/clipping (verify implementation parity).

Replace the two bullets in content/components/light/_index.md (around lines 646–647) with the explicit recurrence and clipping below; docs show defaults alpha = 95% and intensity = 1.5% — verify the implementation uses these defaults, that the update uses next = alpha * prev + (1 − alpha) * random_offset per channel (or adjust wording if the code uses the opposite EMA convention), and that outputs are clamped to [0%,100%].

  • alpha (Optional, percentage): Smoothing/memory factor for the random offset per channel. Each step uses an exponential blend
    offset_next = alpha · offset_prev + (1 − alpha) · random_offset. Higher alpha → smoother/slower changes; lower alpha → quicker/rougher changes. Defaults to 95%.
  • intensity (Optional, percentage): Magnitude of the per‑step random_offset as a percentage of full‑scale channel value. Applied independently to all active color channels; higher values cause larger brightness/color excursions. Values that push channels below 0% or above 100% are clipped. Defaults to 1.5%.

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.

1 participant