Address comment in integration Riemann sum PR #55875 (#55895)

* https://github.com/home-assistant/core/pull/55875\#discussion_r703334504

* missing test update
This commit is contained in:
Diogo Gomes 2021-09-07 18:40:20 +01:00 committed by GitHub
parent 0684f8bddf
commit d705b35ea1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -106,7 +106,7 @@ class IntegrationSensor(RestoreEntity, SensorEntity):
"""Initialize the integration sensor."""
self._sensor_source_id = source_entity
self._round_digits = round_digits
self._state = STATE_UNAVAILABLE
self._state = None
self._method = integration_method
self._name = name if name is not None else f"{source_entity} integral"

View File

@ -123,7 +123,7 @@ async def test_restore_state_failed(hass: HomeAssistant) -> None:
state = hass.states.get("sensor.integration")
assert state
assert state.state == "unavailable"
assert state.state == "unknown"
assert state.attributes.get("unit_of_measurement") is None
assert state.attributes.get("state_class") == STATE_CLASS_TOTAL