-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore light state on boot #61
Conversation
Trying to solve #47
WalkthroughThe pull request introduces new configuration options for light and relay entities in two ESPHome configuration files. Specifically, it adds Changes
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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)
ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml (1)
47-47
: Well-structured implementation of boot state restoration.The implementation follows a systematic approach by:
- Applying the restore mode to the main light strip
- Cascading it through model-specific partitions
- Ensuring individual LEDs and relay indicators maintain the same behavior
- Maintaining consistency between EU and US models
This comprehensive implementation ensures predictable behavior across all light components on boot.
Also applies to: 56-56, 189-190, 424-424
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml
(4 hunks)ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml
(1 hunks)
🔇 Additional comments (4)
ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml (2)
32-32
: LGTM: Consistent state restoration behavior for light outputs.
The addition of restore_mode: RESTORE_DEFAULT_OFF
ensures the light output defaults to off state on boot, which aligns with the PR objective.
Line range hint 424-424
: LGTM: Consistent implementation across all relay lights.
The restore_mode: RESTORE_DEFAULT_OFF
configuration is correctly applied to the relay light template, ensuring all relay lights consistently default to off state on boot.
ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml (2)
47-47
: LGTM: Proper state restoration for main light control.
The addition of restore_mode: RESTORE_DEFAULT_OFF
to light_full
ensures the main NeoPixelBus light strip defaults to off state on boot.
56-56
: LGTM: Consistent state restoration across all light partitions.
The restore_mode: RESTORE_DEFAULT_OFF
configuration is correctly applied to both model-specific lights and individual LED templates, ensuring consistent behavior across all light segments.
Also applies to: 189-190
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml (1)
28-31
: Well-structured implementation of light state restoration.The implementation provides a comprehensive solution for managing light states on boot:
- Separate restore mode configurations for different light categories
- Safe default-off behavior prevents unexpected light activation
- Consistent application across both EU and US models
- Integration with the existing boot initialization process
The architecture allows for future customization of restore behavior per light category if needed.
Also applies to: 52-52, 61-61, 194-194, 428-428
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml
(5 hunks)ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml
(6 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_relays.yaml
🔇 Additional comments (4)
ESPHome/TX-Ultimate-Easy-ESPHome_core_hw_leds.yaml (4)
28-31
: LGTM! Well-structured restore mode configuration.
The separation into distinct restore mode variables for different light categories (full, sides, individual, relays) with RESTORE_DEFAULT_OFF
provides a safe default state on boot while maintaining flexibility for future customization.
52-52
: LGTM! Appropriate restore mode for the main light controller.
Setting RESTORE_DEFAULT_OFF
for the primary NeoPixelBus controller ensures a predictable and safe initial state for all LEDs on boot.
61-61
: LGTM! Consistent restore mode for model-specific light partitions.
The LIGHT_SIDES_RESTORE_MODE
is appropriately applied to the partition template used by both EU and US models, maintaining consistency in boot behavior.
428-428
: LGTM! Appropriate restore mode for relay indicator lights.
The LIGHT_RELAYS_RESTORE_MODE
is correctly applied to the relay lights template, ensuring consistent boot behavior for all relay status indicators.
As suggested by CodeRabbitAI
Trying to solve #47
Summary by CodeRabbit
restore_mode
options for light entities, ensuring they default to an off state upon system restart.RELAY_RESTORE_MODE
for relay entities, enhancing their initialization behavior.