feat(crow_alarm_panel): add raw-frame logging toggle switch - #9
Merged
Conversation
Raw bus frames previously only logged at VERBOSE. Adds a type: log_raw_frames switch that forces the raw-frame log line to INFO while enabled, so raw traffic can be inspected without recompiling with a higher logger level. Defaults to the mdi:text-box-search-outline icon. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds an optional “debug” switch to the crow_alarm_panel integration that lets users elevate the existing raw-frame receive log line from VERBOSE to INFO at runtime, without rebuilding with a higher logger level.
Changes:
- Introduces a new
switch:typelog_raw_frames(pure software toggle) that flips a flag on the parent component. - Updates the C++ loop raw-frame logging to emit at
INFOwhen the toggle is enabled, otherwise keepsVERBOSE. - Documents and exercises the new switch in
README.mdandcrow_alarm_panel_test.yaml.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crow_alarm_panel_test.yaml | Adds the new log_raw_frames switch to the canonical fixture. |
| components/crow_alarm_panel/switch/crow_alarm_panel_switch.h | Declares the new CrowAlarmPanelRawLogSwitch switch type. |
| components/crow_alarm_panel/switch/crow_alarm_panel_switch.cpp | Implements the switch behavior by toggling the parent’s raw-frame logging flag. |
| components/crow_alarm_panel/switch/init.py | Adds the new typed schema entry and wires codegen to set the parent pointer. |
| components/crow_alarm_panel/README.md | Documents the new switch type, including behavior and default icon. |
| components/crow_alarm_panel/crow_alarm_panel.h | Adds a setter and member flag for raw-frame logging at INFO. |
| components/crow_alarm_panel/crow_alarm_panel.cpp | Switches the raw-frame log line between ESP_LOGI and ESP_LOGV based on the flag. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
switch: type: log_raw_framesplatform that forces the raw-frame log line (Received raw frame [...], normallyVERBOSE-only) to also log atINFO, so raw bus traffic can be inspected at runtime without recompiling with a higher logger level.mdi:text-box-search-outlineicon (overridable viaicon:).Test plan
uv run esphome config crow_alarm_panel_test.yamlvalidatesuv run esphome compile crow_alarm_panel_test.yamlbuilds successfullyGenerated with Claude Code