Skip to content

Fix: Climate page crash and screensaver ignoring user settings#81

Merged
edwardtfn merged 17 commits intomainfrom
v9999.99.9
Mar 31, 2026
Merged

Fix: Climate page crash and screensaver ignoring user settings#81
edwardtfn merged 17 commits intomainfrom
v9999.99.9

Conversation

@edwardtfn
Copy link
Copy Markdown
Owner

@edwardtfn edwardtfn commented Mar 31, 2026

Two fixes in this release: the climate page was crashing due to a regression introduced in the previous release, and the screensaver was not respecting the user's configured behavior (turn off or show time).

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added indoor temperature display and icon on the home page.
  • Bug Fixes & Improvements

    • Screensaver settings now apply more reliably at startup.
    • Boot sequence simplified for faster completion.
    • Theme handling refined for more consistent page visuals.
    • Minimum compatibility thresholds updated.
  • UI Updates

    • Removed boot-page progress bar.
    • Adjusted home-page icon visibility and reboot touch behavior.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

📝 Walkthrough

Walkthrough

Removed several nspanel_easy sdkconfig options and the utilities blueprint flag; refactored boot and display initialization; moved screensaver setup to timer-driven apply logic; added indoor temperature visibility and screensaver globals across HMI variants; renumbered boot page component IDs; tightened weather-page theming and bumped blueprint/version thresholds.

Changes

Cohort / File(s) Summary
Module config & constants
components/nspanel_easy/__init__.py
Deleted four public config keys and removed code that forwarded disable_bootloader_logs, lwip_tcp_mss, main_task_stack_size, and task_wdt_timeout_s into sdkconfig/defines.
Blueprint status bitfield
components/nspanel_easy/base.h
Removed page_utilities bit from BlueprintStatusFlags, increased reserved bits (2→3), and updated counting/completion logic (TOTAL_ACTIVE_FLAGS 6→5).
Boot sequence & display init
esphome/nspanel_esphome_boot.yaml, esphome/nspanel_esphome_hw_display.yaml, esphome/nspanel_esphome_page_boot.yaml
Removed boot_progress script and its calls; moved Nextion button_back_font and wakeup_page_id init into an extended boot_nextion script; updated reboot button component ID (21→20).
Screensaver apply flow
esphome/nspanel_esphome_page_screensaver.yaml, hmi/dev/.../screensaver.txt
Replaced direct preinitialize/brightness scripts with page_screensaver_apply_settings and delayed/apply-with-timer flows; added local Timer apply_settings in HMI screensaver pages to apply dim/color/font/pco and disable itself.
Utilities / home icon logic
esphome/nspanel_esphome_page_utilities.yaml, esphome/nspanel_esphome_api.yaml, esphome/nspanel_esphome_core.yaml
Removed several utilities action handlers and page_home_icon_visibility script; excluded indr_temp_icon from persistent vis_%s update; removed verbose utilities page log.
Log level tweaks & upload config
esphome/nspanel_esphome_base.yaml, esphome/nspanel_esphome_addon_climate_base.yaml, esphome/nspanel_esphome_addon_upload_tft.yaml
Adjusted readiness log levels (warnings→verbose, verbose→info) and removed an nspanel_easy LwIP/task-wdt config block from upload TFT addon.
Blueprint and compatibility
nspanel_easy_blueprint.yaml, esphome/nspanel_esphome_version.yaml
Bumped blueprint/version thresholds (blueprint 15→16, tft 14→15); blueprint YAML reorganizations and entity-id anchor consolidation.
HMI globals — indoor temp & screensaver
hmi/dev/*/Program.s.txt, hmi/dev/*/home.txt
Added vis_indr_temp global and vis wiring for indr_temp/indr_temp_icon across HMI locales; added screensaver_font=4 and screensaver_pco=16904 globals.
Boot page ID shifts
hmi/dev/*/boot.txt, hmi/dev/*/.../boot.txt
Removed Progress Bar progress (ID 1) and decremented subsequent component/variable IDs across multiple HMI variants; updated timers and reboot button IDs accordingly.
Weather page theming
hmi/dev/*/weather0[1-5].txt (all locales)
Moved page-wide styling inside if(theme==1) and removed else fallback assignments so theming now applies only when theme==1 (applies across weather01–05 in all HMI variants).
Misc. HMI adjustments
hmi/dev/*/screensaver.txt, hmi/dev/*/home.txt
Converted preinitialize screensaver assignments to timer-driven apply; added/updated screensaver font/pco handling; added indoor-temp visibility lines in home pages.

Sequence Diagram(s)

(No sequence diagrams generated.)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Poem

🐰 The IDs slipped down, a progress bar fell,

Screensaver timers wake the screen so well,
Utilities trimmed from the flag-field view,
New temp icons peek where only numbers grew,
Blueprint bumped, the theme rules now align — hop, hop, design! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The pull request title accurately describes the main fixes: addressing a climate page crash and screensaver settings issues.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v9999.99.9

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
Copy Markdown
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: 3

🧹 Nitpick comments (2)
components/nspanel_easy/base.h (1)

80-85: Update stale bit-range/count comments after reducing active flags to five.

Lines 80–85 and 89–99 still describe six active flags (bits 0–5), but code now tracks five active flags. Please align the comments to prevent confusion.

📝 Suggested doc/comment alignment
-  * `@brief` Check if all active flags (bits 0-5) are set
-  * `@return` true if all active flags (bits 0-5) are set, false otherwise
+  * `@brief` Check if all active flags (bits 0-4) are set
+  * `@return` true if all active flags (bits 0-4) are set, false otherwise
@@
-    // All 6 active flags must be set
+    // All 5 active flags must be set
@@
-  * `@brief` Count active flags (bits 0-5) set
+  * `@brief` Count active flags (bits 0-4) set
@@
-  * `@return` Percentage (0.0-100.0) of active flags set (bits 0-5)
+  * `@return` Percentage (0.0-100.0) of active flags set (bits 0-4)

Also applies to: 89-90, 97-99

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/nspanel_easy/base.h` around lines 80 - 85, The comments describing
"six active flags (bits 0-5)" are stale—update them to reflect there are five
active flags (bits 0-4) and adjust any phrasing that mentions "6" or "bits 0-5";
specifically update the docblock for all_active_flags_set() and any nearby
comment blocks that reference the old bit range so they state five active flags
(bits 0-4) and list the tracked flags (page_home, page_qrcode, relay_settings,
version, hw_buttons_settings) to match the boolean return logic.
esphome/nspanel_esphome_hw_display.yaml (1)

637-638: Consider guarding runtime wakeup_page_id send for consistency.

Line 638 always sends the value, while boot init only sends when wakeup_page_id > 0 (Line 177). Mirroring that guard here would make behavior consistent and safer.

♻️ Suggested consistency patch
         - lambda: |-
             wakeup_page_id = get_page_id(x.c_str());
-            disp1->send_command_printf("wakeup_page_id=%" PRIu8, wakeup_page_id);
+            if (wakeup_page_id > 0) {
+              disp1->send_command_printf("wakeup_page_id=%" PRIu8, wakeup_page_id);
+            }
             wait_to_be_ready->execute();
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@esphome/nspanel_esphome_hw_display.yaml` around lines 637 - 638, The code
always calls disp1->send_command_printf("wakeup_page_id=%" PRIu8,
wakeup_page_id) after computing wakeup_page_id via get_page_id(x.c_str()); make
this consistent with the boot/init path by only sending the command when
wakeup_page_id > 0; locate the get_page_id(...) call and wrap the
disp1->send_command_printf(...) call in an if (wakeup_page_id > 0) { ... } so
the runtime behavior matches the existing boot-time guard.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@esphome/nspanel_esphome_page_boot.yaml`:
- Line 11: PAGE_BOOT_COMPONENT_ID_BT_REBOOT was changed to 20 but
nspanel_easy_landscape/boot.txt still defines bt_reboot as 21, causing a
mismatch; update the bt_reboot ID in nspanel_easy_landscape/boot.txt to 20 (or
revert PAGE_BOOT_COMPONENT_ID_BT_REBOOT to 21) so all boot.txt variants use the
same ID, and verify the constant PAGE_BOOT_COMPONENT_ID_BT_REBOOT and the
bt_reboot entries across all boot.txt files are consistent.

In `@esphome/nspanel_esphome_version.yaml`:
- Around line 14-15: The min_tft_version (currently set to 15) conflicts with
the landscape variant which still declares version: 13 in
hmi/dev/nspanel_easy_landscape/boot.txt; fix by updating the landscape
boot.txt's version field from 13 to 15 so it matches the other device variants
and satisfies min_tft_version, or alternatively adjust min_tft_version to 13 if
you intend to support the older landscape firmware—modify either the
min_tft_version value or the version line in
hmi/dev/nspanel_easy_landscape/boot.txt accordingly.

In `@nspanel_easy_blueprint.yaml`:
- Around line 8330-8344: The current conditional only sets component and icon
color when repeat.item.label_color_rgb != [200, 204, 200], so when
label_color_rgb returns to the default [200, 204, 200] the previous tint
remains; update the templated block around the conditional that calls esphome.{{
nspanel_name }}_component_color (for id '{{ repeat.item.component }}' and '{{
repeat.item.component }}_icon') to include an else branch that explicitly sets
both component and icon back to the default palette color (i.e., send the
default RGB value) and keep continue_on_error/delays consistent with the
existing then branch so the UI always resets when label_color_rgb equals [200,
204, 200].

---

Nitpick comments:
In `@components/nspanel_easy/base.h`:
- Around line 80-85: The comments describing "six active flags (bits 0-5)" are
stale—update them to reflect there are five active flags (bits 0-4) and adjust
any phrasing that mentions "6" or "bits 0-5"; specifically update the docblock
for all_active_flags_set() and any nearby comment blocks that reference the old
bit range so they state five active flags (bits 0-4) and list the tracked flags
(page_home, page_qrcode, relay_settings, version, hw_buttons_settings) to match
the boolean return logic.

In `@esphome/nspanel_esphome_hw_display.yaml`:
- Around line 637-638: The code always calls
disp1->send_command_printf("wakeup_page_id=%" PRIu8, wakeup_page_id) after
computing wakeup_page_id via get_page_id(x.c_str()); make this consistent with
the boot/init path by only sending the command when wakeup_page_id > 0; locate
the get_page_id(...) call and wrap the disp1->send_command_printf(...) call in
an if (wakeup_page_id > 0) { ... } so the runtime behavior matches the existing
boot-time guard.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3a8f6c94-bd9b-4ea0-b57f-1b921f359e14

📥 Commits

Reviewing files that changed from the base of the PR and between c78f730 and 29d9125.

📒 Files selected for processing (82)
  • components/nspanel_easy/__init__.py
  • components/nspanel_easy/base.h
  • esphome/nspanel_esphome_addon_climate_base.yaml
  • esphome/nspanel_esphome_addon_upload_tft.yaml
  • esphome/nspanel_esphome_api.yaml
  • esphome/nspanel_esphome_base.yaml
  • esphome/nspanel_esphome_boot.yaml
  • esphome/nspanel_esphome_core.yaml
  • esphome/nspanel_esphome_hw_display.yaml
  • esphome/nspanel_esphome_hw_memory.yaml
  • esphome/nspanel_esphome_page_boot.yaml
  • esphome/nspanel_esphome_page_home.yaml
  • esphome/nspanel_esphome_page_screensaver.yaml
  • esphome/nspanel_esphome_page_utilities.yaml
  • esphome/nspanel_esphome_version.yaml
  • hmi/dev/nspanel_CJK_eu_code/Program.s.txt
  • hmi/dev/nspanel_CJK_eu_code/boot.txt
  • hmi/dev/nspanel_CJK_eu_code/home.txt
  • hmi/dev/nspanel_CJK_eu_code/screensaver.txt
  • hmi/dev/nspanel_CJK_eu_code/weather01.txt
  • hmi/dev/nspanel_CJK_eu_code/weather02.txt
  • hmi/dev/nspanel_CJK_eu_code/weather03.txt
  • hmi/dev/nspanel_CJK_eu_code/weather04.txt
  • hmi/dev/nspanel_CJK_eu_code/weather05.txt
  • hmi/dev/nspanel_CJK_us_code/Program.s.txt
  • hmi/dev/nspanel_CJK_us_code/boot.txt
  • hmi/dev/nspanel_CJK_us_code/home.txt
  • hmi/dev/nspanel_CJK_us_code/screensaver.txt
  • hmi/dev/nspanel_CJK_us_code/weather01.txt
  • hmi/dev/nspanel_CJK_us_code/weather02.txt
  • hmi/dev/nspanel_CJK_us_code/weather03.txt
  • hmi/dev/nspanel_CJK_us_code/weather04.txt
  • hmi/dev/nspanel_CJK_us_code/weather05.txt
  • hmi/dev/nspanel_CJK_us_land_code/Program.s.txt
  • hmi/dev/nspanel_CJK_us_land_code/boot.txt
  • hmi/dev/nspanel_CJK_us_land_code/home.txt
  • hmi/dev/nspanel_CJK_us_land_code/screensaver.txt
  • hmi/dev/nspanel_CJK_us_land_code/weather01.txt
  • hmi/dev/nspanel_CJK_us_land_code/weather02.txt
  • hmi/dev/nspanel_CJK_us_land_code/weather03.txt
  • hmi/dev/nspanel_CJK_us_land_code/weather04.txt
  • hmi/dev/nspanel_CJK_us_land_code/weather05.txt
  • hmi/dev/nspanel_eu_code/Program.s.txt
  • hmi/dev/nspanel_eu_code/boot.txt
  • hmi/dev/nspanel_eu_code/home.txt
  • hmi/dev/nspanel_eu_code/screensaver.txt
  • hmi/dev/nspanel_eu_code/weather01.txt
  • hmi/dev/nspanel_eu_code/weather02.txt
  • hmi/dev/nspanel_eu_code/weather03.txt
  • hmi/dev/nspanel_eu_code/weather04.txt
  • hmi/dev/nspanel_eu_code/weather05.txt
  • hmi/dev/nspanel_us_code/Program.s.txt
  • hmi/dev/nspanel_us_code/boot.txt
  • hmi/dev/nspanel_us_code/home.txt
  • hmi/dev/nspanel_us_code/screensaver.txt
  • hmi/dev/nspanel_us_code/weather01.txt
  • hmi/dev/nspanel_us_code/weather02.txt
  • hmi/dev/nspanel_us_code/weather03.txt
  • hmi/dev/nspanel_us_code/weather04.txt
  • hmi/dev/nspanel_us_code/weather05.txt
  • hmi/dev/nspanel_us_land_code/Program.s.txt
  • hmi/dev/nspanel_us_land_code/boot.txt
  • hmi/dev/nspanel_us_land_code/home.txt
  • hmi/dev/nspanel_us_land_code/screensaver.txt
  • hmi/dev/nspanel_us_land_code/weather01.txt
  • hmi/dev/nspanel_us_land_code/weather02.txt
  • hmi/dev/nspanel_us_land_code/weather03.txt
  • hmi/dev/nspanel_us_land_code/weather04.txt
  • hmi/dev/nspanel_us_land_code/weather05.txt
  • hmi/nspanel_CJK_eu.HMI
  • hmi/nspanel_CJK_eu.tft
  • hmi/nspanel_CJK_us.HMI
  • hmi/nspanel_CJK_us.tft
  • hmi/nspanel_CJK_us_land.HMI
  • hmi/nspanel_CJK_us_land.tft
  • hmi/nspanel_eu.HMI
  • hmi/nspanel_eu.tft
  • hmi/nspanel_us.HMI
  • hmi/nspanel_us.tft
  • hmi/nspanel_us_land.HMI
  • hmi/nspanel_us_land.tft
  • nspanel_easy_blueprint.yaml
💤 Files with no reviewable changes (2)
  • esphome/nspanel_esphome_addon_upload_tft.yaml
  • esphome/nspanel_esphome_core.yaml

@edwardtfn edwardtfn changed the title Fix Fix: Climate page crash and screensaver ignoring user settings Mar 31, 2026
@edwardtfn edwardtfn merged commit 80b3953 into main Mar 31, 2026
32 checks passed
@edwardtfn edwardtfn deleted the v9999.99.9 branch March 31, 2026 14:04
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