Versions
- Python: 3.12
- OS: macos
- Pymodbus: 3.5.4
- Mypy : 1.5.1
Pymodbus Specific
Description
Mypy fails to validate standard async client calls due to incompatible type annotations in ModbusClientMixin.
Code and Logs
Following code
client = AsyncModbusTcpClient(HOST)
await client.connect()
coils = await client.read_coils(address=0, count=1, slave=SLAVE_ID)
Makes mypy fails with:
__main__.py:18: error: Incompatible types in "await" (actual type "ModbusResponse", expected type "Awaitable[Any]")