Skip to content
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

Feature/sensor cse7761 #2546

Merged
merged 9 commits into from
Oct 28, 2021
Merged

Feature/sensor cse7761 #2546

merged 9 commits into from
Oct 28, 2021

Conversation

berfenger
Copy link
Contributor

@berfenger berfenger commented Oct 18, 2021

What does this implement/fix?

Adds CSE7761 power sensor component, a power sensor present on Sonoff Dual R3 v1.x

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes esphome/feature-requests#1151

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#1541

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266

Example entry for config.yaml:

# Example config.yaml
uart:
  tx_pin: GPIO25
  rx_pin: GPIO26
  baud_rate: 38400
  parity: EVEN
  stop_bits: 1

sensor:
  platform: cse7761
  voltage:
    name: 'CSE7761 Voltage'
  current_1:
    name: 'CSE7761 Current 1'
  current_2:
    name: 'CSE7761 Current 2'
  active_power_1:
    name: 'CSE7761 Active Power 1'
  active_power_2:
    name: 'CSE7761 Active Power 2'
  update_interval: 5s

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@probot-esphome
Copy link

Hey there @berfenger,
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 = ["@berfenger"]

And run script/build_codeowners.py

(message by NeedsCodeownersLabel)

@berfenger berfenger marked this pull request as ready for review October 18, 2021 18:58
Copy link
Member

@oxan oxan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for your contribution! A few comments:

esphome/components/cse7761/cse7761.cpp Outdated Show resolved Hide resolved
esphome/components/cse7761/cse7761.cpp Outdated Show resolved Hide resolved
esphome/components/cse7761/cse7761.cpp Show resolved Hide resolved
esphome/components/cse7761/cse7761.cpp Show resolved Hide resolved
esphome/components/cse7761/cse7761.cpp Outdated Show resolved Hide resolved
esphome/components/cse7761/cse7761.cpp Outdated Show resolved Hide resolved
esphome/components/cse7761/cse7761.cpp Outdated Show resolved Hide resolved
esphome/components/cse7761/cse7761.cpp Outdated Show resolved Hide resolved
esphome/components/cse7761/cse7761.cpp Outdated Show resolved Hide resolved
esphome/components/cse7761/cse7761.cpp Outdated Show resolved Hide resolved
@berfenger berfenger requested a review from oxan October 22, 2021 23:50
Copy link
Member

@oxan oxan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

esphome/components/cse7761/cse7761.cpp Outdated Show resolved Hide resolved
@oxan oxan merged commit 77dbf84 into esphome:dev Oct 28, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Support for the CSE7761 (as found in the Sonoff DualR3)
2 participants