The Wayback Machine - https://web.archive.org/web/20220111005826/https://github.com/home-assistant/core/pull/61837
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

Expose power & energy usage of VeSync outlets as separate sensors #61837

Merged
merged 4 commits into from Jan 10, 2022

Conversation

@decompil3d
Copy link
Contributor

@decompil3d decompil3d commented Dec 14, 2021

Breaking change

Previous versions of this integration exposed power and energy usage from VeSync outlets as state attributes on the switch entity itself. This used the deprecated properties: current_power_w and today_energy_kwh. In this version, these two attributes have been removed from the switch entity and split into two new diagnostic sensor entities that are attached to the same Device. Automations and template entities based on the state attribute mechanism should be updated accordingly.

Proposed change

This PR removes the current_power_w and today_energy_kwh state attributes from VeSync outlets that previously had such attributes and instead exposes them as diagnostic sensor entities on their own. This allows them to be more easily used in the Energy dashboard. Furthermore, this PR adds the device_info property to all VeSync entities meaning that each device gets a proper Device registration now.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

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

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@probot-home-assistant
Copy link

@probot-home-assistant probot-home-assistant bot commented Dec 14, 2021

Hey there @markperdue, @webdjoe, @TheGardenMonkey, mind taking a look at this pull request as it has been labeled with an integration (vesync) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@thecode
Copy link
Member

@thecode thecode commented Dec 21, 2021

Hi @decompil3d,
I have marked the "Breaking change" for the PR so that it picked up in the release notes for the version it will be released on.

Copy link
Member

@balloob balloob left a comment

Nice!

@balloob balloob merged commit 56c577c into home-assistant:dev Jan 10, 2022
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment