This commit is contained in:
matteo porta 2022-07-12 14:59:26 +02:00
parent 6fd4c9fbda
commit 270f0b01ea

View File

@ -87,7 +87,10 @@ class ModbusComponent(Component):
count = 2
else:
raise NotImplementedError(f"data_type {args[0]!r} is not supported")
return self._decode(self._read(register, count=count), *args, **kwargs)
read = self._read(register, count=count)
if read is not None:
read = self._decode(read, *args, **kwargs)
return read
def write(self, register, data, *args, **kwargs):
if type(register) is str: