4949from .helpers .pulses import PulseLogRecord , calc_log_address
5050from .node import PlugwiseBaseNode
5151
52- CACHE_CURRENT_LOG_ADDRESS = "current_log_address"
5352CACHE_CALIBRATION_GAIN_A = "calibration_gain_a"
5453CACHE_CALIBRATION_GAIN_B = "calibration_gain_b"
5554CACHE_CALIBRATION_NOISE = "calibration_noise"
@@ -978,16 +977,6 @@ async def node_info_update(
978977 await self ._relay_update_state (
979978 node_info .relay_state , timestamp = node_info .timestamp
980979 )
981- if (
982- self ._get_cache (CACHE_CURRENT_LOG_ADDRESS ) is None
983- and node_info .current_logaddress_pointer
984- ):
985- self ._set_cache (
986- CACHE_CURRENT_LOG_ADDRESS ,
987- node_info .current_logaddress_pointer ,
988- )
989- await self .save_cache ()
990-
991980 if self ._current_log_address is not None and (
992981 self ._current_log_address > node_info .current_logaddress_pointer
993982 or self ._current_log_address == 1
@@ -1002,28 +991,9 @@ async def node_info_update(
1002991
1003992 if self ._current_log_address != node_info .current_logaddress_pointer :
1004993 self ._current_log_address = node_info .current_logaddress_pointer
1005- self ._set_cache (
1006- CACHE_CURRENT_LOG_ADDRESS , node_info .current_logaddress_pointer
1007- )
1008- await self .save_cache ()
1009994
1010995 return self ._node_info
1011996
1012- async def _node_info_load_from_cache (self ) -> bool :
1013- """Load node info settings from cache."""
1014- if (
1015- current_log_address := self ._get_cache (CACHE_CURRENT_LOG_ADDRESS )
1016- ) is not None :
1017- self ._current_log_address = int (current_log_address )
1018- _LOGGER .debug (
1019- "circle._node_info_load_from_cache | current_log_address=%s" ,
1020- self ._current_log_address
1021- )
1022- return True
1023-
1024- _LOGGER .debug ("circle._node_info_load_from_cache | current_log_address=None" )
1025- return False
1026-
1027997 # pylint: disable=too-many-arguments
1028998 async def update_node_details (
1029999 self ,
0 commit comments