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

Cleanups in HomeWizard Energy sensors #102936

Closed
wants to merge 5 commits into from
Closed

Cleanups in HomeWizard Energy sensors #102936

wants to merge 5 commits into from

Conversation

frenck
Copy link
Member

@frenck frenck commented Oct 27, 2023

Proposed change

When a HomeWizard Energy device only measures a single phase (e.g., a plug or single-phase kWh meter), it will create a duplicate power sensor.

Normally the integration creates a sensor for each phase + a total. However, when there is just a single phase, the total & the phase sensors, will have the same value (and thus, duplicate data is shown and recorded).

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)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

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
  • I have followed the perfect PR recommendations
  • 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.

To help with the load of incoming pull requests:

@home-assistant
Copy link

Hey there @DCSBL, mind taking a look at this pull request as it has been labeled with an integration (homewizard) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of homewizard can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign homewizard Removes the current integration label and assignees on the pull request, add the integration domain after the command.

@frenck frenck changed the title Do no create duplicate sensors for single phase device in HomeWizard Energy Don't duplicate power sensors for single phase devices in HomeWizard Energy Oct 27, 2023
@frenck frenck added this to the 2023.11.0 milestone Oct 27, 2023
@DCSBL
Copy link
Contributor

DCSBL commented Oct 27, 2023

This maybe needs to be flagged as breaking, as it removes the l1 sensor for sockets/single-phase meters. (Which may cause issues with automations and stuff)

@frenck frenck marked this pull request as draft October 27, 2023 21:33
@frenck
Copy link
Member Author

frenck commented Oct 27, 2023

This maybe needs to be flagged as breaking, as it removes the l1 sensor for sockets/single-phase meters. (Which may cause issues with automations and stuff)

You are right. Going to combine some more breaking changes into this PR in that case, to make a single breaking change PR.

@frenck frenck changed the title Don't duplicate power sensors for single phase devices in HomeWizard Energy Cleanups in HomeWizard Energy sensors Oct 27, 2023
@frenck
Copy link
Member Author

frenck commented Oct 27, 2023

The current state is not good for the HWE-SKT type devices, as they do expose a single phase, but don't expose a total. But, it is past night here now, will pick up in the morning.

@DCSBL
Copy link
Contributor

DCSBL commented Oct 29, 2023

Instead of hiding the duplicate entities, can’t we just disable them by default? This makes it non-breaking.

@DCSBL
Copy link
Contributor

DCSBL commented Oct 29, 2023

The current state is not good for the HWE-SKT type devices, as they do expose a single phase, but don't expose a total. But, it is past night here now, will pick up in the morning.

Let me fix that in the python library, as we plan to add total_power_*_kwh to the actual API.

I will update the library to always have that datapoint when total_power_*_t1_kwh is set.

@frenck
Copy link
Member Author

frenck commented Nov 4, 2023

Closing this one. There is not much in it, but it is intertwined.

@frenck frenck closed this Nov 4, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Nov 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants