You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code in get() to determine if registers should be read has an overly-broad match:
asyncdefget(self) ->dict:
"""Get values of all tags with assigned modbus addresses. Returns: A dictionary of {tag: value} pairs. """result= {}
if'discrete_output'inself.addresses:
result.update(awaitself._read_discrete(self.addresses['discrete_output']))
if'discrete_input'inself.addresses:
result.update(awaitself._read_discrete(self.addresses['discrete_input'],
output=False))
fortypein ['input', 'holding']:
iftypeinself.addresses:
result.update(awaitself._read_registers(type))
for type in ['input'][...] will match discrete_input and therefore try to read input registers, even if none are present in the tags file / self.addresses. This will eventually raise ValueError("Missing data type.")
The text was updated successfully, but these errors were encountered:
The code in
get()
to determine if registers should be read has an overly-broad match:for type in ['input'][...]
will matchdiscrete_input
and therefore try to read input registers, even if none are present in the tags file /self.addresses
. This will eventuallyraise ValueError("Missing data type.")
The text was updated successfully, but these errors were encountered: