@@ -966,30 +966,23 @@ async def node_info_update(
966966 await self .save_cache ()
967967
968968 if self ._current_log_address is not None and (
969- # This can be the case after an energy-reset
970969 self ._current_log_address > node_info .current_logaddress_pointer
971- or ( self ._current_log_address < node_info . current_logaddress_pointer and self . _current_log_address == 0 )
970+ or self ._current_log_address == 1
972971 ):
972+ # Rollover of log address
973+ _LOGGER .debug (
974+ "Rollover log address from %s into %s for node %s" ,
975+ self ._current_log_address ,
976+ node_info .current_logaddress_pointer ,
977+ self ._mac_in_str ,
978+ )
973979
974- if self ._current_log_address is not None and (
975- # Change note: _curr_log_addr lags behind c_l_a__pointer so must be < instead of >
976- self ._current_log_address < node_info .current_logaddress_pointer
977- # Change note: rollover is from 6015 to 0 so must be 6015 instead of 0
978- or self ._current_log_address == 6015
979- ):
980- if self ._current_log_address != node_info .current_logaddress_pointer :
981- # Rollover of log address
982- _LOGGER .debug (
983- "Rollover log address from %s into %s for node %s" ,
984- self ._current_log_address ,
985- node_info .current_logaddress_pointer ,
986- self ._mac_in_str ,
987- )
988- self ._current_log_address = node_info .current_logaddress_pointer
989- self ._set_cache (
990- CACHE_CURRENT_LOG_ADDRESS , node_info .current_logaddress_pointer
991- )
992- await self .save_cache ()
980+ if self ._current_log_address != node_info .current_logaddress_pointer :
981+ self ._current_log_address = node_info .current_logaddress_pointer
982+ self ._set_cache (
983+ CACHE_CURRENT_LOG_ADDRESS , node_info .current_logaddress_pointer
984+ )
985+ await self .save_cache ()
993986
994987 return self ._node_info
995988
0 commit comments