-
-
Notifications
You must be signed in to change notification settings - Fork 2k
add select mode funtion for bl0939 #4711
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: current
Are you sure you want to change the base?
Conversation
WalkthroughThe changes update the BL0939 sensor documentation to clearly specify its two operational modes: "direct connection measurement mode" and "current transformer measurement mode." The text now details that the Sonoff Dual R3 v2 is used for direct measurement, while the Seeed XIAO Power Monitor is used for current transformer measurement. Additionally, a new optional configuration variable Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Sensor
participant Config
User->>Sensor: Initialize sensor with configuration
Sensor->>Config: Retrieve "mode" setting
alt mode is provided as direct_measurement_mode
Config-->>Sensor: Return direct_measurement_mode
Sensor->>User: Activate direct connection measurement (Sonoff Dual R3 v2)
else mode is provided as current_transformer_mode
Config-->>Sensor: Return current_transformer_mode
Sensor->>User: Activate current transformer measurement (Seeed XIAO Power Monitor)
else mode not provided
Config-->>Sensor: Return default (direct_measurement_mode)
Sensor->>User: Activate direct connection measurement (Sonoff Dual R3 v2)
end
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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 (2)
components/sensor/bl0939.rst (2)
10-10
: Clarify Operational Modes Description.
The updated description clearly explains the two sensor modes. For improved readability and consistency with the configuration variable names, consider formatting the mode names using backticks (e.g.,direct_measurement_mode
andcurrent_transformer_mode
). Additionally, add a space before the parenthesis in "Seeed XIAO Power Monitor(Current transformer measurement mode)" to enhance clarity.
49-49
: Fix Minor Typographical Issue.
In the configuration variable description, there is a missing space after the comma ("Select the working mode,divided into ..."). Inserting a space ("Select the working mode, divided into ...") will improve readability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
components/sensor/bl0939.rst
(3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**`: - Do not generate or add any sequence diagrams
**
: - Do not generate or add any sequence diagrams
components/sensor/bl0939.rst
🔇 Additional comments (1)
components/sensor/bl0939.rst (1)
25-25
: Validate Example Configuration for Mode Selection.
The example now includesmode: 'current_transformer_mode'
, which aligns with the new functionality. Ensure that users are aware (via documentation elsewhere) that if not explicitly set, the sensor defaults to the direct measurement mode.
✅ Deploy Preview for esphome ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions. |
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.
As this is a feature matched with a PR in https://github.com/esphome/esphome, please target your PR to the next
branch and rebase.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Description:
bl0939 has direct measurement mode and current transformer measurement mode, and adds support for current transformer measurement mode.
Related issue (if applicable): fixes
Pull request in esphome with YAML changes (if applicable): esphome/esphome#esphome/esphome#8323
Checklist:
I am merging into
next
because this is new documentation that has a matching pull-request in esphome as linked above.or
I am merging into
current
because this is a fix, change and/or adjustment in the current documentation and is not for a new component or feature.Link added in
/index.rst
when creating new documents for new components or cookbook.