Bootstrap main components repo with crow_alarm_panel and uv dev environment - #1
Conversation
…e docs Agent-Logs-Url: https://github.com/dan-s-github/esphome-components/sessions/f8015637-c53d-44c0-b32f-2fa463f91642 Co-authored-by: dan-s-github <20974454+dan-s-github@users.noreply.github.com>
|
@copilot change merge target to dev |
There was a problem hiding this comment.
Pull request overview
Bootstraps this repository as a home for custom ESPHome components by adding a components/ layout, a uv-managed Python environment for local validation, and an initial crow_alarm_panel external component with a sample compile/test configuration.
Changes:
- Added repo documentation and a local
uv-based workflow for runningesphome config/compile. - Introduced
components/crow_alarm_panelcomponent with multiple sub-platforms (ACP, button, switch, binary_sensor, text_sensor) and C++ bus handling. - Added a sample
crow_alarm_panel_test.yamlfor local validation/compilation and updated repo hygiene (.gitignore).
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents repo purpose, uv workflow, and external_components usage. |
| pyproject.toml | Defines a uv-managed Python environment with an ESPHome dependency. |
| crow_alarm_panel_test.yaml | Provides a sample ESP32 configuration to validate/compile the component. |
| .gitignore | Ignores .venv/ and uv.lock for the uv workflow. |
| components/crow_alarm_panel/init.py | Core component schema/codegen for pins, keypad address, keypads list, and on_message trigger. |
| components/crow_alarm_panel/README.md | Component-specific documentation and YAML example. |
| components/crow_alarm_panel/crow_alarm_panel.h | Declares the main C++ component, ISR store, and platform integration hooks. |
| components/crow_alarm_panel/crow_alarm_panel.cpp | Implements bus ISR receive logic, packet TX, message decoding, and arm/disarm sequencing. |
| components/crow_alarm_panel/crow_alarm_control_panel.cpp | Implements ACP control() mapping to arm/disarm actions. |
| components/crow_alarm_panel/alarm_control_panel/init.py | ESPHome ACP platform codegen wiring to the parent component. |
| components/crow_alarm_panel/binary_sensor/init.py | ESPHome binary_sensor platform codegen for zone/bypass. |
| components/crow_alarm_panel/button/init.py | ESPHome button platform codegen for arm/disarm actions. |
| components/crow_alarm_panel/button/crow_alarm_panel_button.h | C++ button implementation mapping presses to parent actions. |
| components/crow_alarm_panel/switch/init.py | ESPHome switch platform codegen for output control. |
| components/crow_alarm_panel/switch/crow_alarm_panel_switch.h | C++ switch base/derived classes for Crow outputs. |
| components/crow_alarm_panel/switch/crow_alarm_panel_switch.cpp | C++ switch implementations calling parent output control and logging config. |
| components/crow_alarm_panel/text_sensor/init.py | ESPHome text_sensor platform codegen for armed state reporting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | Component | Description | | ||
| |-----------|-------------| | ||
| | [crow_alarm_panel](components/crow_alarm_panel/README.md) | Integration for Arrowhead Crow alarm panels via the keypad bus | |
There was a problem hiding this comment.
The Markdown table has an extra leading | on the header/separator rows (|| ...), which prevents the table from rendering correctly. Replace || with a single | on those lines.
There was a problem hiding this comment.
You're right — the table in README.md is correctly formatted with single | delimiters. The reviewer comment was incorrect; no change is needed here.
| case ARMED_STATE: { | ||
| if (armed_state_ != nullptr) { | ||
| if (data[0] == 0x00 && data[1] == 0x01) { | ||
| this->armed_state_->publish_state("arming"); | ||
| ESP_LOGD(TAG, "Arming [%02x.%s]", type, format_hex_pretty(data).c_str()); | ||
| if (this->alarm_control_panel_ != nullptr) { | ||
| this->alarm_control_panel_->publish_state(alarm_control_panel::ACP_STATE_ARMING); | ||
| } | ||
| } else if (data[0] == 0x01 && data[1] == 0x00) { | ||
| this->armed_state_->publish_state("armed_away"); |
There was a problem hiding this comment.
In the ARMED_STATE handler, the code reads data[0] and data[1] without checking data.size(). If a short/empty frame is received, this will read out of bounds. Add a length guard (e.g., require at least 2 bytes) before accessing.
There was a problem hiding this comment.
Done in commit 5cae879. Added a data.size() < 2 guard at the top of the ARMED_STATE case — if the frame is too short, it logs a warning and breaks without accessing data[0]/data[1].
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
The merge target is already set to |
Agent-Logs-Url: https://github.com/dan-s-github/esphome-components/sessions/f36df2a9-98b4-4f85-b1e8-5106e6e7aad2 Co-authored-by: dan-s-github <20974454+dan-s-github@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dan-s-github/esphome-components/sessions/789e0231-e4fd-49b3-aeab-47f24a93a9d2 Co-authored-by: dan-s-github <20974454+dan-s-github@users.noreply.github.com>
|
@copilot in a follow-up session |
Establishes this repo as the canonical home for custom ESPHome components, with a
components/directory layout and auv-managed Python environment for local compilation and validation.Changes
Component:
crow_alarm_panelcomponents/crow_alarm_panel/alarm_control_panel,binary_sensor,button,switch,text_sensorcrow_alarm_panel.h,crow_alarm_panel.cpp,crow_alarm_control_panel.cppBuild environment
pyproject.tomldeclaresesphome>=2026.3.0as a dependency, managed viauvuv sync && source .venv/bin/activatethen standardesphomeCLITest configuration
crow_alarm_panel_test.yaml— sample ESP32 config exercising all sub-platforms for localesphome config/esphome compilevalidationRepo hygiene
.gitignore— added.venv/anduv.lockREADME.md— documents setup steps andexternal_componentsusage pattern: