From d705b35ea1fb7800efcc77f4e3f08a3d1ec961d7 Mon Sep 17 00:00:00 2001 From: Diogo Gomes Date: Tue, 7 Sep 2021 18:40:20 +0100 Subject: [PATCH] Address comment in integration Riemann sum PR #55875 (#55895) * https://github.com/home-assistant/core/pull/55875\#discussion_r703334504 * missing test update --- homeassistant/components/integration/sensor.py | 2 +- tests/components/integration/test_sensor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/integration/sensor.py b/homeassistant/components/integration/sensor.py index c0e4a723515..250d10cd9c4 100644 --- a/homeassistant/components/integration/sensor.py +++ b/homeassistant/components/integration/sensor.py @@ -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" diff --git a/tests/components/integration/test_sensor.py b/tests/components/integration/test_sensor.py index 354f4af95ba..03a43fd2c66 100644 --- a/tests/components/integration/test_sensor.py +++ b/tests/components/integration/test_sensor.py @@ -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