File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -589,7 +589,6 @@ async def energy_log_update(
589589
590590 _LOGGER .debug ("EnergyLogs from node %s, address=%s:" , self ._mac_in_str , address )
591591 await self ._available_update_state (True , response .timestamp )
592- energy_record_update = False
593592
594593 # Forward historical energy log information to energy counters
595594 # Each response message contains 4 log counters (slots) of the
@@ -608,17 +607,16 @@ async def energy_log_update(
608607 self ._energy_counters .add_empty_log (response .log_address , _slot )
609608 continue
610609
611- await self ._energy_log_record_update_state (
610+ cache_updated = await self ._energy_log_record_update_state (
612611 response .log_address ,
613612 _slot ,
614613 log_timestamp .replace (tzinfo = UTC ),
615614 log_pulses ,
616615 import_only = True ,
617616 )
618- energy_record_update = True
619617
620618 self ._energy_counters .update ()
621- if energy_record_update and self . _cache_enabled and save_cache :
619+ if cache_updated and save_cache :
622620 _LOGGER .debug (
623621 "Saving energy record update to cache for %s" , self ._mac_in_str
624622 )
You can’t perform that action at this time.
0 commit comments