Skip to content

Commit 01f498f

Browse files
authored
Clarify previous state in total_increasing warning message (home-assistant#158805)
1 parent 15055b8 commit 01f498f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

homeassistant/components/sensor/recorder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,8 @@ def warn_dip(
416416
_LOGGER.warning(
417417
(
418418
"Entity %s %shas state class total_increasing, but its state is not"
419-
" strictly increasing. Triggered by state %s (%s) with last_updated set"
420-
" to %s. Please %s"
419+
" strictly increasing. Triggered by state %s (previous state: %s) with"
420+
" last_updated set to %s. Please %s"
421421
),
422422
entity_id,
423423
f"from integration {domain} " if domain else "",

tests/components/sensor/test_recorder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,8 +2261,8 @@ async def test_compile_hourly_sum_statistics_total_increasing_small_dip(
22612261
last_updated = states["sensor.test1"][6].last_updated.isoformat()
22622262
assert (
22632263
"Entity sensor.test1 has state class total_increasing, but its state is not "
2264-
f"strictly increasing. Triggered by state {state} ({previous_state}) with "
2265-
f"last_updated set to {last_updated}. Please create a bug report at "
2264+
f"strictly increasing. Triggered by state {state} (previous state: {previous_state}) "
2265+
f"with last_updated set to {last_updated}. Please create a bug report at "
22662266
"https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue"
22672267
) in caplog.text
22682268
statistic_ids = await async_list_statistic_ids(hass)

0 commit comments

Comments
 (0)