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 last_reset_type and convert all those sensors to TOTAL_INCREASING #2233

Merged
merged 3 commits into from Sep 5, 2021

Conversation

jesserockz
Copy link
Member

@jesserockz jesserockz commented Sep 3, 2021

What does this implement/fix?

This PR removes the recently added last_reset_type and replaces all sensors that were using state_class: MEASUREMENT + last_reset_type with state_class: TOTAL_INCREASING.

The resetting is now handled in home assistant automatically.

Breaking

This is a breaking change for any templates sensors, or sensors where users have added last_reset_type in YAML manually.

This is also a breaking change for any custom components using sensor.sensor_schema(...) or sensor.SENSOR_SCHEMA as the last_reset_type argument has been removed.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#1442

Test Environment

  • ESP32
  • ESP8266

Example entry for config.yaml:

# Example config.yaml

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

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

@probot-esphome
Copy link

probot-esphome bot commented Sep 3, 2021

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

@probot-esphome
Copy link

probot-esphome bot commented Sep 3, 2021

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

@probot-esphome
Copy link

probot-esphome bot commented Sep 3, 2021

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

@probot-esphome
Copy link

probot-esphome bot commented Sep 3, 2021

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

@probot-esphome
Copy link

probot-esphome bot commented Sep 3, 2021

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

@probot-esphome
Copy link

probot-esphome bot commented Sep 3, 2021

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

@probot-esphome
Copy link

probot-esphome bot commented Sep 3, 2021

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

@project-bot project-bot bot moved this from Needs Review to By Code Owner in ESPHome Dev Sep 3, 2021
@jesserockz jesserockz merged commit ff6bed5 into dev Sep 5, 2021
@jesserockz jesserockz deleted the total-increasing-sensors branch September 5, 2021 20:30
ESPHome Dev automation moved this from By Code Owner to Done Sep 5, 2021
@jesserockz jesserockz mentioned this pull request Sep 8, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Sep 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.