python-selve-new 2.5.7__tar.gz → 2.5.8__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 (109) hide show
  1. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/PKG-INFO +1 -1
  2. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/python_selve_new.egg-info/PKG-INFO +1 -1
  3. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/_version.py +3 -3
  4. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/util/serial_transport.py +34 -1
  5. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/.github/FUNDING.yml +0 -0
  6. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/.github/architect.chatmode.md +0 -0
  7. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/.github/ask.chatmode.md +0 -0
  8. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/.github/code.chatmode.md +0 -0
  9. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/.github/debug.chatmode.md +0 -0
  10. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/.github/workflows/python-publish.yml +0 -0
  11. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/.github/workflows/tests.yml +0 -0
  12. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/.gitignore +0 -0
  13. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/.idea/.gitignore +0 -0
  14. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
  15. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/.idea/misc.xml +0 -0
  16. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/.idea/modules.xml +0 -0
  17. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/.idea/python-selve-new.iml +0 -0
  18. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/.idea/vcs.xml +0 -0
  19. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/CHANGELOG.md +0 -0
  20. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/LICENSE +0 -0
  21. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/README.md +0 -0
  22. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/coverage_xdist_example.txt +0 -0
  23. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/debug_response.py +0 -0
  24. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/debug_test.bat +0 -0
  25. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/direct_hardware_test.bat +0 -0
  26. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/direct_hardware_test.py +0 -0
  27. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/generate_coverage.bat +0 -0
  28. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/package.sh +0 -0
  29. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/pyproject.toml +0 -0
  30. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/python_selve_new.egg-info/SOURCES.txt +0 -0
  31. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/python_selve_new.egg-info/dependency_links.txt +0 -0
  32. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/python_selve_new.egg-info/requires.txt +0 -0
  33. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/python_selve_new.egg-info/top_level.txt +0 -0
  34. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/release.py +0 -0
  35. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/run_all_tests.bat +0 -0
  36. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/run_hardware_tests.bat +0 -0
  37. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/run_integration_tests.bat +0 -0
  38. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/run_mock_tests.bat +0 -0
  39. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/run_single_test.bat +0 -0
  40. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/run_tests.bat +0 -0
  41. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/__init__.py +0 -0
  42. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/commands/__init__.py +0 -0
  43. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/commands/command.py +0 -0
  44. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/commands/device.py +0 -0
  45. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/commands/event.py +0 -0
  46. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/commands/firmware.py +0 -0
  47. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/commands/group.py +0 -0
  48. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/commands/iveo.py +0 -0
  49. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/commands/param.py +0 -0
  50. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/commands/senSim.py +0 -0
  51. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/commands/sender.py +0 -0
  52. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/commands/sensor.py +0 -0
  53. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/commands/service.py +0 -0
  54. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/device.py +0 -0
  55. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/gateway.py +0 -0
  56. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/group.py +0 -0
  57. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/iveo.py +0 -0
  58. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/senSim.py +0 -0
  59. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/sender.py +0 -0
  60. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/sensor.py +0 -0
  61. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/util/__init__.py +0 -0
  62. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/util/errors.py +0 -0
  63. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/selve/util/protocol.py +0 -0
  64. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/setup.cfg +0 -0
  65. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/setup.py +0 -0
  66. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/setup_and_test.bat +0 -0
  67. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/__init__.py +0 -0
  68. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/conftest.py +0 -0
  69. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/integration/README.md +0 -0
  70. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/integration/__init__.py +0 -0
  71. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/integration/conftest.py +0 -0
  72. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/integration/test_device_integration.py +0 -0
  73. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/integration/test_selve_gateway_integration.py +0 -0
  74. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/integration/test_selve_hardware.py +0 -0
  75. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/integration/test_selve_integration.py +0 -0
  76. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/test_import.py +0 -0
  77. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/test_replacement.py +0 -0
  78. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/__init__.py +0 -0
  79. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/mock_utils.py +0 -0
  80. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_command_coverage.py +0 -0
  81. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_commands.py +0 -0
  82. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_device.py +0 -0
  83. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_device_classes_coverage.py +0 -0
  84. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_device_commands_extended.py +0 -0
  85. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_gateway_configuration_issues.py +0 -0
  86. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_gateway_error_handling_fixed.py +0 -0
  87. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_group.py +0 -0
  88. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_group_commands.py +0 -0
  89. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_missing_components.py +0 -0
  90. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_mock_commands.py +0 -0
  91. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_mock_devices_and_groups.py +0 -0
  92. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_mock_sensors_and_senders.py +0 -0
  93. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_param_commands_extended.py +0 -0
  94. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_port_discovery.py +0 -0
  95. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_selve_advanced_coverage.py +0 -0
  96. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_selve_core_coverage.py +0 -0
  97. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_selve_edge_cases.py +0 -0
  98. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_selve_gateway.py +0 -0
  99. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_selve_init_comprehensive.py +0 -0
  100. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_selve_init_response_coverage.py +0 -0
  101. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_selve_init_simple.py +0 -0
  102. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_selve_main_class_extensive.py +0 -0
  103. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_sender_commands_extended.py +0 -0
  104. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_sensim_commands_extended.py +0 -0
  105. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_sensor_commands_extended.py +0 -0
  106. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_service_command_errors.py +0 -0
  107. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_service_commands.py +0 -0
  108. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_util.py +0 -0
  109. {python_selve_new-2.5.7 → python_selve_new-2.5.8}/tests/unit/test_utility_coverage.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-selve-new
3
- Version: 2.5.7
3
+ Version: 2.5.8
4
4
  Summary: Python library for interfacing with selve devices using the USB-RF controller. Written completely new.
5
5
  Home-page: https://github.com/Kannix2005/python-selve-new
6
6
  Author: Stefan Altheimer
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-selve-new
3
- Version: 2.5.7
3
+ Version: 2.5.8
4
4
  Summary: Python library for interfacing with selve devices using the USB-RF controller. Written completely new.
5
5
  Home-page: https://github.com/Kannix2005/python-selve-new
6
6
  Author: Stefan Altheimer
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '2.5.7'
22
- __version_tuple__ = version_tuple = (2, 5, 7)
21
+ __version__ = version = '2.5.8'
22
+ __version_tuple__ = version_tuple = (2, 5, 8)
23
23
 
24
- __commit_id__ = commit_id = 'gaf58df608'
24
+ __commit_id__ = commit_id = 'g2562749e3'
@@ -5,6 +5,8 @@ from typing import Optional
5
5
  import serialx
6
6
  from serialx import Parity
7
7
 
8
+ _READLINE_TIMEOUT = 12.0 # seconds — gateway goes silent during RF motor ops
9
+
8
10
 
9
11
  class SerialTransport:
10
12
  """Async serial transport using serialx (replaces pyserial + background thread)."""
@@ -36,6 +38,7 @@ class SerialTransport:
36
38
 
37
39
  async def ensure_open(self) -> None:
38
40
  if not self.is_open:
41
+ self._logger.info("Serial: opening %s", self._port)
39
42
  self._reader, self._writer = await serialx.open_serial_connection(
40
43
  url=self._port,
41
44
  baudrate=self._baudrate,
@@ -46,8 +49,10 @@ class SerialTransport:
46
49
  rtscts=False,
47
50
  dsrdtr=False,
48
51
  )
52
+ self._logger.info("Serial: %s opened, reader=%r writer=%r", self._port, self._reader, self._writer)
49
53
 
50
54
  async def close(self) -> None:
55
+ self._logger.info("Serial: closing %s", self._port)
51
56
  try:
52
57
  if self._writer and not self._writer.is_closing():
53
58
  self._writer.close()
@@ -56,34 +61,60 @@ class SerialTransport:
56
61
  self._logger.debug("Serial close failed", exc_info=True)
57
62
  self._reader = None
58
63
  self._writer = None
64
+ self._logger.info("Serial: %s closed", self._port)
59
65
 
60
66
  async def start_reader(self, rx_queue: asyncio.Queue) -> None:
61
67
  """Opens the serial port and starts the async reader task."""
62
68
  await self.ensure_open()
63
69
  self._rx_queue = rx_queue
64
70
  if self._reader_task and not self._reader_task.done():
71
+ self._logger.info("Serial: reader task already running")
65
72
  return
73
+ self._logger.info("Serial: starting reader task, reader=%r", self._reader)
66
74
  self._reader_task = asyncio.create_task(
67
75
  self._reader_loop(), name="selve-serial-reader"
68
76
  )
69
77
 
70
78
  async def stop_reader(self) -> None:
71
79
  if self._reader_task:
80
+ self._logger.info("Serial: stopping reader task")
72
81
  self._reader_task.cancel()
73
82
  try:
74
83
  await self._reader_task
75
84
  except asyncio.CancelledError:
76
85
  pass
77
86
  self._reader_task = None
87
+ self._logger.info("Serial: reader task stopped")
78
88
 
79
89
  async def _reader_loop(self) -> None:
90
+ self._logger.info("Serial: reader loop started, reader=%r at_eof=%s",
91
+ self._reader,
92
+ self._reader.at_eof() if self._reader else "N/A")
80
93
  buffer = ""
94
+ iteration = 0
81
95
  while True:
82
96
  try:
83
97
  if self._reader is None:
98
+ self._logger.warning("Serial: reader is None in loop, reopening")
84
99
  await self.ensure_open()
85
- line_bytes = await self._reader.readline()
100
+ self._logger.debug("Serial: awaiting readline (iter=%d, buf=%r)", iteration, buffer)
101
+ line_bytes = await asyncio.wait_for(
102
+ self._reader.readline(), timeout=_READLINE_TIMEOUT
103
+ )
104
+ self._logger.debug("Serial: readline returned %d bytes (iter=%d)", len(line_bytes), iteration)
105
+ iteration += 1
106
+ except asyncio.TimeoutError:
107
+ self._logger.warning(
108
+ "Serial: readline timeout after %.0fs (iter=%d, buf=%r) — reconnecting",
109
+ _READLINE_TIMEOUT, iteration, buffer,
110
+ )
111
+ buffer = ""
112
+ await self.close()
113
+ await asyncio.sleep(1.0)
114
+ await self.ensure_open()
115
+ continue
86
116
  except asyncio.CancelledError:
117
+ self._logger.info("Serial: reader loop cancelled")
87
118
  break
88
119
  except (OSError, EOFError) as exc:
89
120
  self._logger.error("Serial read error: %s", exc)
@@ -95,6 +126,8 @@ class SerialTransport:
95
126
  continue
96
127
 
97
128
  if not line_bytes:
129
+ self._logger.debug("Serial: readline returned empty bytes (EOF?), reader.at_eof=%s",
130
+ self._reader.at_eof() if self._reader else "N/A")
98
131
  await asyncio.sleep(0.01)
99
132
  continue
100
133