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

Move Z-Wave JS smoke, CO, CO2, Heat, Water problem entities to diagnostic #129922

Draft
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

balloob
Copy link
Member

@balloob balloob commented Nov 6, 2024

Breaking change

Proposed change

My Z-Wave smoke/CO alarm has a ton of entities as primary sensors.

image

I believe that things like "End of life" should be marked as diagnostic. This PR adjusts this.

Updated thee notifications.json link to point at the new location (an Excel spreadsheet).

I've moved the following entities to the diagnostic category:

Thanks for the updated link @kpine, I've updated the values and the URL in the comment.

With this PR, the following notifications will be moved to diagnostic:

Smoke Alarm

  • State idle
  • Alarm silenced
  • Replacement required
  • Replacement required, End-of-life
  • Maintenance required, planned periodic inspection
  • Maintenance required, dust in device

CO Alarm

  • State idle
  • Carbon monoxide test
  • Replacement required
  • Replacement required, End-of-life
  • Alarm silenced
  • Maintenance required, planned periodic inspection

CO2 Alarm

  • State idle
  • Carbon dioxide test
  • Replacement required
  • Replacement required, End-of-life
  • Alarm silenced
  • Maintenance required, planned periodic inspection

Heat Alarm

  • State idle
  • Rapid temperature rise (location provided)
  • Rapid temperature rise
  • Rapid temperature fall (location provided)
  • Rapid temperature fall
  • Heat alarm test
  • Alarm silenced
  • Replacement required, End-of-life
  • Maintenance required, dust in device
  • Maintenance required, planned periodic inspection

Water Alarm

  • State idle
  • Replace water filter
  • Sump pump failure

I've also updated the specification to no longer have "catch-all" entity descriptions that mark all other entities as device class PROBLEM. Those are now specifically mentioned. That way, we don't mark things having a problem incorrectly (like Heat Alarm Test). (I followed the rule, if device_class is specified, the states key also needs to be specified)

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 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

home-assistant bot commented Nov 6, 2024

Hey there @home-assistant/z-wave, mind taking a look at this pull request as it has been labeled with an integration (zwave_js) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of zwave_js 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 zwave_js 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.

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Looks good. We should add or adjust existing tests to check the entity category of these entities from some example device.

Copy link
Contributor

@kpine kpine left a comment

Choose a reason for hiding this comment

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

@balloob
Copy link
Member Author

balloob commented Nov 9, 2024

Looks good. We should add or adjust existing tests to check the entity category of these entities from some example device.

@MartinHjelmare there doesn't seem to be any tests for these.

@balloob
Copy link
Member Author

balloob commented Nov 9, 2024

Thanks for the updated link @kpine, I've updated the values and the URL in the comment.

With this PR, the following notifications will be moved to diagnostic:

Smoke Alarm

  • State idle
  • Alarm silenced
  • Replacement required
  • Replacement required, End-of-life
  • Maintenance required, planned periodic inspection
  • Maintenance required, dust in device

CO Alarm

  • State idle
  • Carbon monoxide test
  • Replacement required
  • Replacement required, End-of-life
  • Alarm silenced
  • Maintenance required, planned periodic inspection

CO2 Alarm

  • State idle
  • Carbon dioxide test
  • Replacement required
  • Replacement required, End-of-life
  • Alarm silenced
  • Maintenance required, planned periodic inspection

Heat Alarm

  • State idle
  • Rapid temperature rise (location provided)
  • Rapid temperature rise
  • Rapid temperature fall (location provided)
  • Rapid temperature fall
  • Heat alarm test
  • Alarm silenced
  • Replacement required, End-of-life
  • Maintenance required, dust in device
  • Maintenance required, planned periodic inspection

Water Alarm

  • State idle
  • Replace water filter
  • Sump pump failure

@balloob balloob marked this pull request as ready for review November 9, 2024 18:47
@balloob balloob requested a review from a team as a code owner November 9, 2024 18:47
@MartinHjelmare
Copy link
Member

Then please add new tests.

Also please add the summary above as a comment somewhere in the module.

@MartinHjelmare MartinHjelmare marked this pull request as draft November 9, 2024 21:18
@MartinHjelmare
Copy link
Member

@balloob if you can attach the diagnostics dump of your smoke detector device to a comment in this PR someone else can write tests for that device.

Copy link

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.
If you are the author of this PR, please leave a comment if you want to keep it open. Also, please rebase your PR onto the latest dev branch to ensure that it's up to date with the latest changes.
Thank you for your contribution!

@github-actions github-actions bot added the stale label Jan 10, 2025
@balloob
Copy link
Member Author

balloob commented Jan 11, 2025

This still needs to be finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants