aioads 0.1.0.dev10__tar.gz → 0.1.0.dev11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/PKG-INFO +1 -1
  2. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/ads_client.py +20 -2
  3. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/pyproject.toml +1 -1
  4. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/.github/dependabot.yml +0 -0
  5. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/.github/workflows/ci.yml +0 -0
  6. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/.github/workflows/publish.yml +0 -0
  7. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/.gitignore +0 -0
  8. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/.vscode/settings.json +0 -0
  9. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/LICENSE +0 -0
  10. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/README.md +0 -0
  11. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/ads_error_codes.py +0 -0
  12. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/ads_notifications.py +0 -0
  13. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/ads_symbol_cache.py +0 -0
  14. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/ads_symbol_parser.py +0 -0
  15. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/ams_address.py +0 -0
  16. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/ams_header.py +0 -0
  17. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/ams_service_port.py +0 -0
  18. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/ams_tcp_header.py +0 -0
  19. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/commands/ads_add_notification.py +0 -0
  20. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/commands/ads_command.py +0 -0
  21. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/commands/ads_delete_notification.py +0 -0
  22. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/commands/ads_read.py +0 -0
  23. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/commands/ads_read_device_info.py +0 -0
  24. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/commands/ads_read_state.py +0 -0
  25. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/commands/ads_read_write.py +0 -0
  26. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/commands/ads_write.py +0 -0
  27. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/commands/ads_write_state.py +0 -0
  28. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/commands/errors.py +0 -0
  29. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/errors.py +0 -0
  30. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/functions/ads_enable_route.py +0 -0
  31. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/functions/ads_function.py +0 -0
  32. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/functions/ads_sum_read.py +0 -0
  33. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/functions/ads_sum_read_write.py +0 -0
  34. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/functions/ads_symbol_datatype_by_name.py +0 -0
  35. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/functions/ads_symbol_datatype_upload.py +0 -0
  36. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/functions/ads_symbol_info_by_name_ex.py +0 -0
  37. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/functions/ads_symbol_table_version.py +0 -0
  38. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/functions/ads_symbol_upload.py +0 -0
  39. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/functions/ads_symbol_upload_info.py +0 -0
  40. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/py.typed +0 -0
  41. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/stream.py +0 -0
  42. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/transport.py +0 -0
  43. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/aioads/utils/local_ip.py +0 -0
  44. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/docs/transmission_mode.md +0 -0
  45. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/docs/unittest_style_guide.html +0 -0
  46. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/examples/read_cmd_reuse_mqtt.py +0 -0
  47. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/examples/read_cycles.py +0 -0
  48. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/examples/read_cycles_mqtt.py +0 -0
  49. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/examples/read_multiple.py +0 -0
  50. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/examples/read_multiple_mqtt.py +0 -0
  51. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/examples/read_single.py +0 -0
  52. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/pdm.lock +0 -0
  53. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/__init__.py +0 -0
  54. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/builders.py +0 -0
  55. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/integration/README.md +0 -0
  56. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/integration/__init__.py +0 -0
  57. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/integration/base.py +0 -0
  58. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/integration/config.example.toml +0 -0
  59. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/integration/config.py +0 -0
  60. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/integration/test_connection.py +0 -0
  61. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/integration/test_memory.py +0 -0
  62. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/integration/test_performance.py +0 -0
  63. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/integration/test_read_symbols.py +0 -0
  64. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/__init__.py +0 -0
  65. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/commands/__init__.py +0 -0
  66. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/commands/test_ads_add_notification.py +0 -0
  67. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/commands/test_ads_command.py +0 -0
  68. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/commands/test_ads_delete_notification.py +0 -0
  69. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/commands/test_ads_read.py +0 -0
  70. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/commands/test_ads_read_device_info.py +0 -0
  71. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/commands/test_ads_read_state.py +0 -0
  72. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/commands/test_ads_read_write.py +0 -0
  73. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/commands/test_ads_write.py +0 -0
  74. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/commands/test_ads_write_state.py +0 -0
  75. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/commands/test_errors.py +0 -0
  76. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/functions/__init__.py +0 -0
  77. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/functions/test_ads_enable_route.py +0 -0
  78. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/functions/test_ads_function.py +0 -0
  79. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/functions/test_ads_sum_read.py +0 -0
  80. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/functions/test_ads_sum_read_write.py +0 -0
  81. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/functions/test_ads_symbol_datatype_by_name.py +0 -0
  82. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/functions/test_ads_symbol_datatype_upload.py +0 -0
  83. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/functions/test_ads_symbol_info_by_name_ex.py +0 -0
  84. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/functions/test_ads_symbol_table_version.py +0 -0
  85. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/functions/test_ads_symbol_upload.py +0 -0
  86. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/functions/test_ads_symbol_upload_info.py +0 -0
  87. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/test_ads_client.py +0 -0
  88. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/test_ads_error_codes.py +0 -0
  89. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/test_ads_notifications.py +0 -0
  90. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/test_ads_symbol_cache.py +0 -0
  91. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/test_ads_symbol_parser.py +0 -0
  92. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/test_ams_address.py +0 -0
  93. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/test_ams_header.py +0 -0
  94. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/test_ams_tcp_header.py +0 -0
  95. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/test_errors.py +0 -0
  96. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/test_stream.py +0 -0
  97. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/test_transport.py +0 -0
  98. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/utils/__init__.py +0 -0
  99. {aioads-0.1.0.dev10 → aioads-0.1.0.dev11}/tests/unit/utils/test_local_ip.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aioads
3
- Version: 0.1.0.dev10
3
+ Version: 0.1.0.dev11
4
4
  Summary: An asynchronous Python library for communicating with Beckhoff TwinCAT PLCs
5
5
  Author-email: MkKiefer <102972583+MkKiefer@users.noreply.github.com>
6
6
  License: MIT
@@ -1,5 +1,6 @@
1
1
  """ADS Client for communicating with ADS devices asynchronously."""
2
2
 
3
+ import asyncio
3
4
  import logging
4
5
  from contextlib import asynccontextmanager
5
6
  from dataclasses import dataclass
@@ -14,6 +15,7 @@ from aioads.ads_symbol_parser import ISymbolParser
14
15
  from aioads.ams_address import AmsAddress
15
16
  from aioads.commands.ads_add_notification import TransmissionMode
16
17
  from aioads.commands.ads_read import AdsReadCommand
18
+ from aioads.commands.ads_read import AdsReadResponse
17
19
  from aioads.commands.ads_read_state import ReadStateCommand
18
20
  from aioads.commands.errors import AdsCommandError
19
21
  from aioads.functions.ads_enable_route import AdsEnableRoute
@@ -24,6 +26,7 @@ from aioads.functions.ads_symbol_datatype_upload import AdsSymbolDataTypeUpload
24
26
  from aioads.functions.ads_symbol_info_by_name_ex import SymbolInfo
25
27
  from aioads.functions.ads_symbol_upload import AdsSymbolUpload
26
28
  from aioads.functions.ads_symbol_upload_info import AdsSymbolUploadInfo2
29
+ from aioads.stream import AdsStream
27
30
  from aioads.transport import AdsTcpTransport
28
31
  from aioads.transport import ITransport
29
32
 
@@ -292,7 +295,7 @@ class AdsClient:
292
295
  # Pre-seed the result with lookup errors so the output preserves the
293
296
  # requested order; successful entries are overwritten after the read.
294
297
  # Symbols with a failed lookup cannot be read: their idx_group/offset
295
- # would misalign the bulk response.
298
+ # would misaligne the bulk response.
296
299
  output: dict[str, SymbolReadResult] = {
297
300
  name: SymbolReadResult(error_code, None)
298
301
  for name, (error_code, _) in symbol_infos.items()
@@ -322,6 +325,22 @@ class AdsClient:
322
325
  )
323
326
  response = await sum_read.execute()
324
327
 
328
+ # Parsing is pure-Python and O(total payload size); run it off the
329
+ # event loop so large bulk reads don't block other tasks.
330
+ parsed = await asyncio.to_thread(
331
+ self._parse_sum_read_response, readable, response)
332
+ output.update(parsed)
333
+ return output
334
+
335
+ def _parse_sum_read_response(
336
+ self,
337
+ readable: list[tuple[str, SymbolInfo]],
338
+ response: list[tuple[AdsReadResponse, AdsStream]],
339
+ ) -> dict[str, SymbolReadResult]:
340
+ """
341
+ Parse the payloads of a bulk read into symbol values.
342
+ """
343
+ output: dict[str, SymbolReadResult] = {}
325
344
  for (name, info), (read_response, resp_payload) in zip(
326
345
  readable, response, strict=True
327
346
  ):
@@ -336,7 +355,6 @@ class AdsClient:
336
355
  raw_data=resp_payload,
337
356
  ),
338
357
  )
339
-
340
358
  return output
341
359
 
342
360
  @asynccontextmanager
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "aioads"
3
- version = "0.1.0.dev10"
3
+ version = "0.1.0.dev11"
4
4
  description = "An asynchronous Python library for communicating with Beckhoff TwinCAT PLCs"
5
5
  authors = [
6
6
  { name = "MkKiefer", email = "102972583+MkKiefer@users.noreply.github.com" },
File without changes
File without changes
File without changes
File without changes