Skip to content

Update Zwave js to use state class total increasing#54600

Closed
Danielhiversen wants to merge 3 commits intodevfrom
zwave_total
Closed

Update Zwave js to use state class total increasing#54600
Danielhiversen wants to merge 3 commits intodevfrom
zwave_total

Conversation

@Danielhiversen
Copy link
Copy Markdown
Member

Breaking change

Proposed change

Update Zwave js to use state class total increasing and total

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

  • 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
  • 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.
  • 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:

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
@probot-home-assistant
Copy link
Copy Markdown

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!
(message by CodeOwnersMention)

@Danielhiversen Danielhiversen changed the title Update Zwave js to use state class total increasing and total Update Zwave js to use state class total increasing Aug 13, 2021
Copy link
Copy Markdown
Contributor

@raman325 raman325 left a comment

Choose a reason for hiding this comment

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

We should also get rid of the logic in async_added_to_hass that sets up a listener for last reset along with the dispatcher in the meter_reset service since we no longer need to set last reset

@Danielhiversen
Copy link
Copy Markdown
Member Author

Danielhiversen commented Aug 13, 2021

So we will remove SERVICE_RESET_METER?
How is that intended to be used?

@raman325
Copy link
Copy Markdown
Contributor

So we will remove SERVICE_RESET_METER?
How is that intended to be used?

We should keep the service, but there is logic in there to dispatch a signal every time the service is called so that the listener we set up in async_added_to_hass calls back to set last_reset to now

@raman325
Copy link
Copy Markdown
Contributor

raman325 commented Aug 13, 2021

I guess what I am not clear on is for meters that aren't in the energy device class, should we still track last reset or not? The PR implies we don't want to track last reset at all, in which case we should remove this logic entirely: https://github.com/home-assistant/core/blob/dev/homeassistant/components/zwave_js/sensor.py#L254-L294

Remove the RestoreEntity as a mixin, and remove https://github.com/home-assistant/core/blob/dev/homeassistant/components/zwave_js/sensor.py#L318-L325

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
@Danielhiversen Danielhiversen deleted the zwave_total branch August 18, 2021 12:33
@github-actions github-actions bot locked and limited conversation to collaborators Aug 19, 2021
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.

3 participants