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

Remove invalid watts sensor from NUT #140334

Closed

Conversation

tdfountain
Copy link
Contributor

Proposed change

Remove the "watts" sensor since it is invalid. This appears like a breaking change, but is not actually a breaking change. NUT variables are based on RFC 9271 available at https://www.rfc-editor.org/info/rfc9271 with a complete list of num names at https://github.com/networkupstools/nut/blob/master/docs/nut-names.txt. These variables generally take the form of x.y. The variable name "watts" is not a valid variable name. The sensor is therefore invalid and cannot be used. This PR removes the sensor from sensor.py and the translation from strings.json. It is not listed in icons.json. There are no test cases that reference this invalid sensor.

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:
  • Link to developer documentation pull request:
  • Link to frontend 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 Ruff (ruff format 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.

To help with the load of incoming pull requests:

@home-assistant
Copy link

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

Code owner commands

Code owners of nut 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 nut Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

bdraco
bdraco previously approved these changes Mar 11, 2025
Copy link
Member

@bdraco bdraco left a comment

Choose a reason for hiding this comment

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

Thanks @tdfountain

@bdraco
Copy link
Member

bdraco commented Mar 11, 2025

Looks like this was added in #55491

I agree based on above that it appears to be invalid. However it seems like the user who opened the PR was able to get it to work with their device so I'm not sure we should remove it.

@bdraco bdraco dismissed their stale review March 11, 2025 04:51

Pending discussion in #140334 (comment)

@tdfountain
Copy link
Contributor Author

@wranglatang, I proposed at PR to remove the "watt" NUT variable as a separate sensor. Can you please shed light on whether you made this sensor work, and if so, how? Thanks for your help and contribution! We want to make sure not to remove functionality that users are dependent upon.

The NUT documentation does not list "watt" as a valid variable. The naming format is inconsistent with other NUT variables (which are generally x.y). Finally, I reviewed the NUT source code and I am unable find any instances of the "watt" variable from any device driver.

@bdraco
Copy link
Member

bdraco commented Mar 21, 2025

Based on the information above, I can't see how this sensor could ever work. We haven't heard back from the original submitter though so I am going to give them a bit more time before merging

@frenck
Copy link
Member

frenck commented Mar 25, 2025

Meanswhile, there is a merge conflict. Could you take a look @tdfountain?

Thanks! 👍

../Frenck

@frenck frenck marked this pull request as draft March 25, 2025 08:37
@tdfountain tdfountain closed this Mar 25, 2025
@tdfountain tdfountain force-pushed the remove-invalid-watts-sensor branch from c61830e to 73642da Compare March 25, 2025 17:52
@tdfountain
Copy link
Contributor Author

Please see PR #141401. My apologies, I inadvertently closed the branch when committing the merge.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 26, 2025
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.

4 participants