Enable basic type checking for recorder (#52440)

* Enable basic type checking for recorder

* Tweak
This commit is contained in:
Erik Montnemery 2021-07-13 21:21:45 +02:00 committed by GitHub
parent 960684346f
commit 19d3aa71ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 108 additions and 39 deletions

View file

@ -244,7 +244,7 @@ def compile_statistics(
last_reset = old_last_reset = None
new_state = old_state = None
_sum = 0
last_stats = statistics.get_last_statistics(hass, 1, entity_id) # type: ignore
last_stats = statistics.get_last_statistics(hass, 1, entity_id)
if entity_id in last_stats:
# We have compiled history for this sensor before, use that as a starting point
last_reset = old_last_reset = last_stats[entity_id][0]["last_reset"]