Remove STATE_CLASS_TOTAL and last_reset from sensor (#54755)

* Remove STATE_CLASS_TOTAL

* Update mill sensor

* Update tests

* Kill last_reset

* Return ATTR_LAST_RESET to utility_meter

* Update energy cost sensor

* Restore last_reset for backwards compatibility

* Re-add and update deprecation warning

* Update tests

* Fix utility_meter

* Update EnergyCostSensor

* Tweak

* Fix rebase mistake

* Fix test
This commit is contained in:
Erik Montnemery 2021-08-18 10:03:27 +02:00 committed by GitHub
parent 85d9890447
commit e1926caeb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 68 additions and 251 deletions

View file

@ -44,9 +44,8 @@ async def test_deprecated_last_reset(hass, caplog, enable_custom_integrations):
assert (
"Entity sensor.test (<class 'custom_components.test.sensor.MockSensor'>) "
"with state_class measurement has set last_reset. Setting last_reset for "
"entities with state_class other than 'total' is deprecated and will be "
"removed from Home Assistant Core 2021.10. Please update your configuration if "
"state_class is manually configured, otherwise report it to the custom "
"component author."
"with state_class measurement has set last_reset. Setting last_reset is "
"deprecated and will be unsupported from Home Assistant Core 2021.11. Please "
"update your configuration if state_class is manually configured, otherwise "
"report it to the custom component author."
) in caplog.text