Skip to content

Commit

Permalink
handler: add erase cache option in read data all
Browse files Browse the repository at this point in the history
in order to call various times read data all in a handler, allow to not
erase the cached results
  • Loading branch information
clavay authored and trombastic committed Feb 13, 2024
1 parent 71d128a commit 3c45c56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyscada/device.py
Expand Up @@ -98,13 +98,13 @@ def read_data_and_time(self, variable_instance):

return self.read_data(variable_instance), self.time()

def read_data_all(self, variables_dict):
def read_data_all(self, variables_dict, erase_cache=True):
output = []

if self.before_read():
for item in variables_dict.values():
value, read_time = self.read_data_and_time(item)
if value is not None and read_time is not None and item.update_values(value, read_time):
if value is not None and read_time is not None and item.update_values(value, read_time, erase_cache=erase_cache):
output.append(item)
self.after_read()
return output
Expand Down

0 comments on commit 3c45c56

Please sign in to comment.