-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
add dfrobot_c4001 #10675
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
base: dev
Are you sure you want to change the base?
add dfrobot_c4001 #10675
Conversation
|
To use the changes from this PR as an external component, add the following to your ESPHome configuration YAML file: external_components:
- source: github://pr#10675
components: [dfrobot_c4001]
refresh: 1h(Added by the PR bot) |
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.
📦 Pull Request Size
This PR is too large with 1683 line changes (excluding tests). Please consider breaking it down into smaller, focused PRs to make review easier and reduce the risk of conflicts.
For guidance on breaking down large PRs, see: https://developers.esphome.io/contributing/submitting-your-work/#how-to-approach-large-submissions
👥 Code Ownership
Hey there @96liuzhixin,
Thanks for submitting this pull request! Can you add yourself as a codeowner for this integration? This way we can notify you if a bug report for this integration is reported.
In __init__.py of the integration, please add:
CODEOWNERS = ["@96liuzhixin"]And run script/build_codeowners.py
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #10675 +/- ##
==========================================
- Coverage 72.46% 72.43% -0.03%
==========================================
Files 53 53
Lines 11152 11152
Branches 1510 1510
==========================================
- Hits 8081 8078 -3
- Misses 2676 2678 +2
- Partials 395 396 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
📦 Pull Request Size
This PR is too large with 1589 line changes (excluding tests). Please consider breaking it down into smaller, focused PRs to make review easier and reduce the risk of conflicts.
For guidance on breaking down large PRs, see: https://developers.esphome.io/contributing/submitting-your-work/#how-to-approach-large-submissions
|
I have attached the document. This is the PR link. esphome/esphome-docs#5349 |
|
I already have a DFRobot C4001 PR #9810 in progress here and it's already broken up into 4 parts to meets their 1000 line requirements and it's fairly complete including LED control. Take a look and let me know what you think. |
|
We are the official developers of DF and we understand the sensor’s characteristics better: According to our testing and the official documentation, the OUT LED and RUN LED have no control functionality. We tested their library and found that it cannot obtain the sensor’s exact configuration; in practice, the library also fails to perform this function. Our implementation is more user-friendly for data acquisition. Their library shows this error: “[E][component:145]: dfrobot_c4001 is marked FAILED: Too many errors.” We recommend using our library instead, and we will continue to update and address any issues that arise in the future. |
I should have looked at your github page. It's great when manufacturers get involved and support projects like this. It's good for your business and it's good for us the users. A lot of companies can't or won't do this. Thank you very much! I'll be eager to test when ready! |
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.
📦 Pull Request Size
This PR is too large with 1589 line changes (excluding tests). Please consider breaking it down into smaller, focused PRs to make review easier and reduce the risk of conflicts.
For guidance on breaking down large PRs, see: https://developers.esphome.io/contributing/submitting-your-work/#how-to-approach-large-submissions
Memory Impact AnalysisComponents:
📊 Component Memory Breakdown
🔍 Symbol-Level Changes (click to expand)Changed Symbols
New Symbols (top 15)
This analysis runs automatically when components change. Memory usage is measured from a representative test configuration. |
What does this implement/fix?
Add support for the DFRobot C4001 motion sensor as an external component in ESPHome.
This includes a main component (
c4001Component) and a binary sensor (C4001BinarySensor) for presence detection.It allows users to configure the sensor via YAML and exposes motion detection to Home Assistant.
Types of changes
Related issue or feature (if applicable):
Pull request in esphome-docs with documentation (if applicable):
Test Environment
Example entry for
config.yaml: