PyPlumIO 0.7.8__tar.gz → 0.7.8.post1__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 (154) hide show
  1. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/PKG-INFO +1 -1
  2. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/docs/source/cli.rst +6 -6
  3. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/cli/__init__.py +1 -1
  4. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/cli/state.py +10 -10
  5. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyproject.toml +1 -1
  6. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/cli/test_init.py +2 -1
  7. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/cli/test_state.py +88 -0
  8. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/cli/test_ui.py +20 -12
  9. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/.gitignore +0 -0
  10. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/LICENSE +0 -0
  11. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/README.md +0 -0
  12. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/docs/Makefile +0 -0
  13. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/docs/make.bat +0 -0
  14. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/docs/source/callbacks.rst +0 -0
  15. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/docs/source/conf.py +0 -0
  16. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/docs/source/connecting.rst +0 -0
  17. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/docs/source/frames.rst +0 -0
  18. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/docs/source/index.rst +0 -0
  19. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/docs/source/mixers_thermostats.rst +0 -0
  20. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/docs/source/protocol.rst +0 -0
  21. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/docs/source/reading.rst +0 -0
  22. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/docs/source/schedules.rst +0 -0
  23. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/docs/source/writing.rst +0 -0
  24. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/__init__.py +0 -0
  25. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/__main__.py +0 -0
  26. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/cli/app.py +0 -0
  27. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/cli/codegen.py +0 -0
  28. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/cli/model.py +0 -0
  29. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/cli/session.py +0 -0
  30. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/cli/ui.py +0 -0
  31. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/connection.py +0 -0
  32. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/const.py +0 -0
  33. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/data_types.py +0 -0
  34. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/devices/__init__.py +0 -0
  35. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/devices/ecomax.py +0 -0
  36. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/devices/ecoster.py +0 -0
  37. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/devices/mixer.py +0 -0
  38. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/devices/thermostat.py +0 -0
  39. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/exceptions.py +0 -0
  40. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/filters.py +0 -0
  41. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/frames/__init__.py +0 -0
  42. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/frames/messages.py +0 -0
  43. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/frames/requests.py +0 -0
  44. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/frames/responses.py +0 -0
  45. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/helpers/__init__.py +0 -0
  46. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/helpers/async_cache.py +0 -0
  47. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/helpers/event_manager.py +0 -0
  48. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/helpers/task_manager.py +0 -0
  49. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/parameters/__init__.py +0 -0
  50. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/parameters/custom/__init__.py +0 -0
  51. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/parameters/custom/ecomax_350p2_zf.py +0 -0
  52. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/parameters/custom/ecomax_860d3_hb.py +0 -0
  53. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/parameters/custom/ecomax_860p4_nm_touch.py +0 -0
  54. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/parameters/ecomax.py +0 -0
  55. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/parameters/mixer.py +0 -0
  56. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/parameters/thermostat.py +0 -0
  57. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/protocol.py +0 -0
  58. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/py.typed +0 -0
  59. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/stream.py +0 -0
  60. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/structures/__init__.py +0 -0
  61. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/structures/alerts.py +0 -0
  62. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/structures/ecomax_parameters.py +0 -0
  63. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/structures/ecomax_service_parameters.py +0 -0
  64. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/structures/frame_versions.py +0 -0
  65. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/structures/mixer_parameters.py +0 -0
  66. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/structures/network_info.py +0 -0
  67. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/structures/product_info.py +0 -0
  68. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/structures/program_version.py +0 -0
  69. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/structures/regulator_data.py +0 -0
  70. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/structures/regulator_data_schema.py +0 -0
  71. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/structures/schedules.py +0 -0
  72. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/structures/sensor_data.py +0 -0
  73. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/structures/thermostat_parameters.py +0 -0
  74. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/pyplumio/utils.py +0 -0
  75. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/__init__.py +0 -0
  76. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/cli/__init__.py +0 -0
  77. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/cli/conftest.py +0 -0
  78. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/cli/test_app.py +0 -0
  79. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/cli/test_codegen.py +0 -0
  80. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/cli/test_model.py +0 -0
  81. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/cli/test_session.py +0 -0
  82. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/conftest.py +0 -0
  83. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/devices/__init__.py +0 -0
  84. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/devices/test_ecomax.py +0 -0
  85. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/devices/test_ecoster.py +0 -0
  86. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/devices/test_init.py +0 -0
  87. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/devices/test_mixer.py +0 -0
  88. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/devices/test_thermostat.py +0 -0
  89. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/frames/test_init.py +0 -0
  90. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/frames/test_messages.py +0 -0
  91. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/frames/test_requests.py +0 -0
  92. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/frames/test_responses.py +0 -0
  93. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/helpers/__init__.py +0 -0
  94. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/helpers/test_async_cache.py +0 -0
  95. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/helpers/test_event_manager.py +0 -0
  96. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/helpers/test_task_manager.py +0 -0
  97. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/helpers/test_uid.py +0 -0
  98. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/parameters/__init__.py +0 -0
  99. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/parameters/custom/__init__.py +0 -0
  100. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/parameters/custom/test_ecomax_350p2_zf.py +0 -0
  101. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/parameters/custom/test_ecomax_860d3_hb.py +0 -0
  102. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/parameters/custom/test_ecomax_860p4_nm_touch.py +0 -0
  103. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/parameters/custom/test_init.py +0 -0
  104. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/parameters/test_ecomax.py +0 -0
  105. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/parameters/test_init.py +0 -0
  106. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/parameters/test_mixers.py +0 -0
  107. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/parameters/test_thermostats.py +0 -0
  108. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/ruff.toml +0 -0
  109. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/structures/__init__.py +0 -0
  110. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/structures/test_alerts.py +0 -0
  111. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/structures/test_ecomax_parameters.py +0 -0
  112. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/structures/test_ecomax_service_parameters.py +0 -0
  113. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/structures/test_frame_versions.py +0 -0
  114. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/structures/test_mixer_parameters.py +0 -0
  115. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/structures/test_product_info.py +0 -0
  116. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/structures/test_program_version.py +0 -0
  117. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/structures/test_schedules.py +0 -0
  118. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/test_connection.py +0 -0
  119. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/test_data_types.py +0 -0
  120. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/test_filters.py +0 -0
  121. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/test_init.py +0 -0
  122. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/test_main.py +0 -0
  123. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/test_protocol.py +0 -0
  124. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/test_stream.py +0 -0
  125. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/test_utils.py +0 -0
  126. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/messages/regulator_data.json +0 -0
  127. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/messages/sensor_data.json +0 -0
  128. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/parameters/ecomax_350p2_zf.json +0 -0
  129. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/parameters/ecomax_860d3_hb.json +0 -0
  130. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/parameters/ecomax_860p4_nm_touch.json +0 -0
  131. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/requests/alerts.json +0 -0
  132. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/requests/ecomax_control.json +0 -0
  133. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/requests/ecomax_parameters.json +0 -0
  134. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/requests/ecomax_service_parameters.json +0 -0
  135. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/requests/mixer_parameters.json +0 -0
  136. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/requests/set_ecomax_parameter.json +0 -0
  137. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/requests/set_ecomax_service_parameter.json +0 -0
  138. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/requests/set_mixer_parameter.json +0 -0
  139. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/requests/set_schedule.json +0 -0
  140. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/requests/set_thermostat_parameter.json +0 -0
  141. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/requests/thermostat_parameters.json +0 -0
  142. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/responses/alerts.json +0 -0
  143. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/responses/device_available.json +0 -0
  144. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/responses/ecomax_parameters.json +0 -0
  145. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/responses/ecomax_service_parameters.json +0 -0
  146. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/responses/mixer_parameters.json +0 -0
  147. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/responses/password.json +0 -0
  148. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/responses/program_version.json +0 -0
  149. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/responses/regulator_data_schema.json +0 -0
  150. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/responses/schedules.json +0 -0
  151. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/responses/thermostat_parameters.json +0 -0
  152. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/responses/uid.json +0 -0
  153. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/unknown/unknown_ecomax_parameter.json +0 -0
  154. {pyplumio-0.7.8 → pyplumio-0.7.8.post1}/tests/testdata/unknown/unknown_mixer_parameter.json +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: PyPlumIO
3
- Version: 0.7.8
3
+ Version: 0.7.8.post1
4
4
  Summary: PyPlumIO is a native ecoNET library for Plum ecoMAX controllers.
5
5
  Project-URL: Documentation, https://pyplumio.denpa.pro
6
6
  Project-URL: Source Code, https://github.com/denpamusic/PyPlumIO
@@ -13,7 +13,7 @@ Windows Executable
13
13
  On Windows, download the standalone ``pyplumio.exe`` executable from the
14
14
  `GitHub Releases <https://github.com/denpamusic/PyPlumIO/releases>`_ page. No Python
15
15
  installation is required—double-click ``pyplumio.exe`` or run it from Command Prompt
16
- or PowerShell. Generated files (or ``<model_slug>.zip``) are saved in the working
16
+ or PowerShell. Generated files (and optional ``<model_slug>.zip``) are saved in the working
17
17
  directory where ``pyplumio.exe`` is launched unless ``--output`` is specified.
18
18
 
19
19
  Python Package
@@ -55,7 +55,7 @@ The CLI supports the following arguments:
55
55
  --output DIR Output directory for generated files (default: current working directory).
56
56
  --interval SECONDS Polling interval in seconds (default: 2.0).
57
57
  --baudrate BAUDRATE Serial baudrate (default: 115200).
58
- -z, --zip Save output as a ZIP archive.
58
+ -z, --zip Also save output as a ZIP archive.
59
59
 
60
60
  Interactive Connection Setup
61
61
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -131,12 +131,12 @@ Press ``Ctrl+S`` to save generated files. At least one parameter must be mapped;
131
131
 
132
132
  Nothing to save: map at least one parameter first.
133
133
 
134
- Unless ``-z`` / ``--zip`` was passed on the command line, you will be asked ``Save as a ZIP archive? [y/N]``:
134
+ Unless ``-z`` / ``--zip`` was passed on the command line, you will be asked ``Also save as a ZIP archive? [y/N]``:
135
135
 
136
- - Answering ``n`` (or pressing Enter) writes the three generated files directly into the ``<output>`` directory tree. If ``<output>/pyplumio/parameters/custom/<model_slug>.py`` already exists, you will be prompted to confirm overwrite (``Overwrite existing <model_slug>.py? [y/N]``).
137
- - Answering ``y`` (or starting the CLI with ``-z`` / ``--zip``) saves a single ``<output>/<model_slug>.zip`` archive containing the same repository-relative paths inside, which can be attached directly to a GitHub issue instead of opening a PR. If ``<output>/<model_slug>.zip`` already exists, you will be prompted to confirm overwrite (``Overwrite existing <model_slug>.zip? [y/N]``).
136
+ - Answering ``n`` (or pressing Enter) writes only the three generated files directly into the ``<output>`` directory tree. If ``<output>/pyplumio/parameters/custom/<model_slug>.py`` already exists, you will be prompted to confirm overwrite (``Overwrite existing <model_slug>.py? [y/N]``).
137
+ - Answering ``y`` (or starting the CLI with ``-z`` / ``--zip``) writes the three generated files into ``<output>`` and also saves ``<output>/<model_slug>.zip`` containing the same repository-relative paths inside, which can be attached directly to a GitHub issue instead of opening a PR. If ``<model_slug>.py``, ``<model_slug>.zip``, or both already exist, you will be prompted to confirm overwrite (``Overwrite existing <target>? [y/N]``, or ``Overwrite existing <model_slug>.py and <model_slug>.zip? [y/N]`` when both exist).
138
138
 
139
- The utility produces the following three files (either on disk or inside ``<output>/<model_slug>.zip``):
139
+ The utility produces the following three files on disk (and inside ``<output>/<model_slug>.zip`` when ZIP output is requested):
140
140
 
141
141
  1. **Custom Parameter Module**:
142
142
  ``<output>/pyplumio/parameters/custom/<model_slug>.py``
@@ -91,7 +91,7 @@ def _run_cli(argv: Sequence[str] | None) -> int:
91
91
  "--baudrate", type=int, default=DEFAULT_BAUDRATE, help="baudrate"
92
92
  )
93
93
  parser.add_argument(
94
- "-z", "--zip", action="store_true", help="save output as a ZIP archive"
94
+ "-z", "--zip", action="store_true", help="also save output as a ZIP archive"
95
95
  )
96
96
  try:
97
97
  return asyncio.run(run_app(parser.parse_args(argv)))
@@ -81,7 +81,7 @@ PAGE_SIZE: Final = 25
81
81
  INDEX_PROMPT: Final = "Enter parameter index to edit: "
82
82
  NAME_PROMPT: Final = "Name: "
83
83
  COMMENT_PROMPT: Final = "Comment (leave empty for none): "
84
- ZIP_PROMPT: Final = "Save as a ZIP archive? [y/N]: "
84
+ ZIP_PROMPT: Final = "Also save as a ZIP archive? [y/N]: "
85
85
 
86
86
 
87
87
  def _normalize_number(value: float) -> float | int:
@@ -144,14 +144,14 @@ def _save_files(state: AppState) -> None:
144
144
  state.output_dir,
145
145
  comments=state.table.comments,
146
146
  )
147
+ write_files(files)
147
148
  if state.data.save_as_zip:
148
149
  zip_path = zip_archive_path(
149
150
  state.output_dir, model_slug(product_info.model)
150
151
  )
151
152
  write_zip(zip_path, files, state.output_dir)
152
- state.status = f"Files saved to {zip_path}."
153
+ state.status = f"Files saved to {state.output_dir} and {zip_path.name}."
153
154
  else:
154
- write_files(files)
155
155
  state.status = f"Files saved to {state.output_dir}."
156
156
 
157
157
  except (OSError, ValueError) as err:
@@ -264,13 +264,13 @@ class AppState:
264
264
 
265
265
  self.data.save_as_zip = self.zip_output if save_as_zip is None else save_as_zip
266
266
  slug = model_slug(product_info.model)
267
- target_path = (
268
- zip_archive_path(self.output_dir, slug)
269
- if self.data.save_as_zip
270
- else custom_module_path(self.output_dir, slug)
271
- )
272
- if target_path.is_file():
273
- prompt = f"Overwrite existing {target_path.name}? [y/N]: "
267
+ targets = [custom_module_path(self.output_dir, slug)]
268
+ if self.data.save_as_zip:
269
+ targets.append(zip_archive_path(self.output_dir, slug))
270
+
271
+ if existing := [path.name for path in targets if path.is_file()]:
272
+ names = " and ".join(existing)
273
+ prompt = f"Overwrite existing {names}? [y/N]: "
274
274
  return self._set_step(AppStep.OVERWRITE, prompt, buffer)
275
275
 
276
276
  _save_files(self)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "PyPlumIO"
3
- version = "0.7.8"
3
+ version = "0.7.8.post1"
4
4
  authors = [
5
5
  {name = "Denis Paavilainen", email = "denpa@denpa.pro"}
6
6
  ]
@@ -116,10 +116,11 @@ def test_main_eof_error() -> None:
116
116
  mock_pause.assert_called_once()
117
117
 
118
118
 
119
- def test_main_help_and_invalid_argument() -> None:
119
+ def test_main_help_and_invalid_argument(capsys: pytest.CaptureFixture[str]) -> None:
120
120
  """Test main handles SystemExit for --help and invalid arguments."""
121
121
  with patch("pyplumio.cli._pause_before_exit") as mock_pause:
122
122
  assert main(["--help"]) == 0
123
+ assert "also save output as a ZIP archive" in capsys.readouterr().out
123
124
  mock_pause.assert_not_called()
124
125
 
125
126
  assert main(["--unknown-flag"]) == 2
@@ -7,6 +7,7 @@ from unittest.mock import patch
7
7
 
8
8
  from prompt_toolkit.buffer import Buffer
9
9
 
10
+ from pyplumio.cli.codegen import custom_module_path, zip_archive_path
10
11
  from pyplumio.cli.model import ParameterTable
11
12
  from pyplumio.cli.session import Session
12
13
  from pyplumio.cli.state import (
@@ -444,6 +445,93 @@ async def test_app_state_save_and_overwrite(tmp_path: Path) -> None:
444
445
  assert "Error saving files: Invalid parameter" in state.status
445
446
 
446
447
 
448
+ async def test_app_state_save_zip_writes_regular_files(tmp_path: Path) -> None:
449
+ """Test _save_files writes regular output files alongside ZIP when enabled."""
450
+ session = Session(url="socket://localhost:8899")
451
+ session.product_info = dummy_product_info()
452
+ session.last_frame_message = b"\x00" * 40
453
+ session.last_parameters = [
454
+ (0, ParameterValues(value=10, min_value=0, max_value=20))
455
+ ]
456
+ table = ParameterTable()
457
+ table.set_description(0, EcomaxNumberDescription(name="boiler_temp"))
458
+
459
+ state = AppState(session, table, tmp_path)
460
+ state.data.save_as_zip = True
461
+ _save_files(state)
462
+ assert state.status == f"Files saved to {tmp_path} and {DUMMY_SLUG}.zip."
463
+ assert custom_module_path(tmp_path, DUMMY_SLUG).is_file()
464
+ assert (tmp_path / f"tests/parameters/custom/test_{DUMMY_SLUG}.py").is_file()
465
+ assert (tmp_path / f"tests/testdata/parameters/{DUMMY_SLUG}.json").is_file()
466
+ assert zip_archive_path(tmp_path, DUMMY_SLUG).is_file()
467
+
468
+
469
+ async def test_app_state_save_overwrite_combinations(tmp_path: Path) -> None:
470
+ """Test overwrite prompts and cancellation across regular and ZIP targets."""
471
+ session = Session(url="socket://localhost:8899")
472
+ session.product_info = dummy_product_info()
473
+ session.last_frame_message = b"\x00" * 40
474
+ session.last_parameters = [
475
+ (0, ParameterValues(value=10, min_value=0, max_value=20))
476
+ ]
477
+ table = ParameterTable()
478
+ table.set_description(0, EcomaxNumberDescription(name="boiler_temp"))
479
+
480
+ module_path = custom_module_path(tmp_path, DUMMY_SLUG)
481
+ test_path = tmp_path / f"tests/parameters/custom/test_{DUMMY_SLUG}.py"
482
+ data_path = tmp_path / f"tests/testdata/parameters/{DUMMY_SLUG}.json"
483
+ zip_path = zip_archive_path(tmp_path, DUMMY_SLUG)
484
+
485
+ # Only <slug>.py exists -> prompts for <slug>.py, declining cancels without touch
486
+ state = AppState(session, table, tmp_path)
487
+ buff = Buffer()
488
+ module_path.parent.mkdir(parents=True, exist_ok=True)
489
+ module_path.write_text("# existing module", encoding="utf-8")
490
+ state.start_save(buff, save_as_zip=True)
491
+ assert _step(state) == AppStep.OVERWRITE
492
+ assert state.prompt == f"Overwrite existing {DUMMY_SLUG}.py? [y/N]: "
493
+ state.step_overwrite("n", buff)
494
+ assert _step(state) == AppStep.INDEX
495
+ assert state.status == "Save cancelled."
496
+ assert module_path.read_text(encoding="utf-8") == "# existing module"
497
+ assert not zip_path.exists()
498
+
499
+ # Only <slug>.zip exists + save_as_zip=False -> writes regular files immediately
500
+ module_path.unlink()
501
+ zip_path.write_bytes(b"existing zip")
502
+ state.start_save(buff, save_as_zip=False)
503
+ assert _step(state) == AppStep.INDEX
504
+ assert state.status == f"Files saved to {tmp_path}."
505
+ assert module_path.is_file()
506
+ assert test_path.is_file()
507
+ assert data_path.is_file()
508
+ assert zip_path.read_bytes() == b"existing zip"
509
+
510
+ # Only <slug>.zip exists + save_as_zip=True -> prompts for <slug>.zip, decline
511
+ module_path.unlink()
512
+ state.start_save(buff, save_as_zip=True)
513
+ assert _step(state) == AppStep.OVERWRITE
514
+ assert state.prompt == f"Overwrite existing {DUMMY_SLUG}.zip? [y/N]: "
515
+ state.step_overwrite("n", buff)
516
+ assert _step(state) == AppStep.INDEX
517
+ assert state.status == "Save cancelled."
518
+ assert not module_path.exists()
519
+ assert zip_path.read_bytes() == b"existing zip"
520
+
521
+ # Both <slug>.py and <slug>.zip exist -> prompts for both, declining cancels
522
+ module_path.write_text("# existing module", encoding="utf-8")
523
+ state.start_save(buff, save_as_zip=True)
524
+ assert _step(state) == AppStep.OVERWRITE
525
+ assert state.prompt == (
526
+ f"Overwrite existing {DUMMY_SLUG}.py and {DUMMY_SLUG}.zip? [y/N]: "
527
+ )
528
+ state.step_overwrite("n", buff)
529
+ assert _step(state) == AppStep.INDEX
530
+ assert state.status == "Save cancelled."
531
+ assert module_path.read_text(encoding="utf-8") == "# existing module"
532
+ assert zip_path.read_bytes() == b"existing zip"
533
+
534
+
447
535
  def test_format_value_with_unit() -> None:
448
536
  """Test formatting values with units of measurement."""
449
537
  # Unknown or None description
@@ -466,7 +466,7 @@ def test_app_keybindings_and_layout(tmp_path: Path) -> None:
466
466
  table.set_description(0, EcomaxNumberDescription(name="boiler_temp"))
467
467
  bindings["c-s"](mock_event)
468
468
  assert _step(state) == AppStep.ZIP
469
- assert state.prompt == "Save as a ZIP archive? [y/N]: "
469
+ assert state.prompt == "Also save as a ZIP archive? [y/N]: "
470
470
  state.step_zip("n", app_buffer)
471
471
  assert _step(state) == AppStep.INDEX
472
472
  assert state.status == f"Files saved to {tmp_path}."
@@ -737,7 +737,7 @@ async def test_zip_save_flow_tree_and_cancel(tmp_path: Path) -> None:
737
737
  # Ctrl+S asks ZIP question; Esc cancels back to INDEX
738
738
  bindings["c-s"](mock_event)
739
739
  assert _step(state) == AppStep.ZIP
740
- assert state.prompt == "Save as a ZIP archive? [y/N]: "
740
+ assert state.prompt == "Also save as a ZIP archive? [y/N]: "
741
741
  bindings["escape"](mock_event)
742
742
  assert _step(state) == AppStep.INDEX
743
743
  assert state.status == "Cancelled."
@@ -786,12 +786,15 @@ async def test_zip_save_flow_archive(tmp_path: Path) -> None:
786
786
  app_buffer = buffer_ctrl.content.buffer
787
787
  zip_path = tmp_path / f"{DUMMY_SLUG}.zip"
788
788
 
789
- # Answering "y" writes ZIP and resets save_as_zip
789
+ # Answering "y" writes regular files + ZIP and resets save_as_zip
790
790
  bindings["c-s"](mock_event)
791
791
  state.step_zip("y", app_buffer)
792
792
  assert _step(state) == AppStep.INDEX
793
- assert state.status == f"Files saved to {zip_path}."
793
+ assert state.status == f"Files saved to {tmp_path} and {zip_path.name}."
794
794
  assert state.data.save_as_zip is False
795
+ assert (tmp_path / f"pyplumio/parameters/custom/{DUMMY_SLUG}.py").is_file()
796
+ assert (tmp_path / f"tests/parameters/custom/test_{DUMMY_SLUG}.py").is_file()
797
+ assert (tmp_path / f"tests/testdata/parameters/{DUMMY_SLUG}.json").is_file()
795
798
  assert zip_path.is_file()
796
799
  with zipfile.ZipFile(zip_path, "r") as archive:
797
800
  assert set(archive.namelist()) == {
@@ -800,24 +803,26 @@ async def test_zip_save_flow_archive(tmp_path: Path) -> None:
800
803
  f"tests/testdata/parameters/{DUMMY_SLUG}.json",
801
804
  }
802
805
 
803
- # Existing ZIP -> OVERWRITE prompt, decline -> "Save cancelled."
806
+ # Existing files + ZIP -> OVERWRITE prompt, decline -> "Save cancelled."
804
807
  bindings["c-s"](mock_event)
805
808
  state.step_zip("y", app_buffer)
806
809
  assert _step(state) == AppStep.OVERWRITE
807
- assert state.prompt == f"Overwrite existing {DUMMY_SLUG}.zip? [y/N]: "
810
+ assert state.prompt == (
811
+ f"Overwrite existing {DUMMY_SLUG}.py and {DUMMY_SLUG}.zip? [y/N]: "
812
+ )
808
813
  assert bool(state.data.save_as_zip) is True
809
814
  state.step_overwrite("n", app_buffer)
810
815
  assert _step(state) == AppStep.INDEX
811
816
  assert state.status == "Save cancelled."
812
817
  assert state.data.save_as_zip is False
813
818
 
814
- # Existing ZIP -> OVERWRITE accept -> rewrites ZIP and resets save_as_zip
819
+ # Existing files + ZIP -> OVERWRITE accept -> rewrites and resets save_as_zip
815
820
  bindings["c-s"](mock_event)
816
821
  state.step_zip("yes", app_buffer)
817
822
  assert _step(state) == AppStep.OVERWRITE
818
823
  state.step_overwrite("y", app_buffer)
819
824
  assert _step(state) == AppStep.INDEX
820
- assert state.status == f"Files saved to {zip_path}."
825
+ assert state.status == f"Files saved to {tmp_path} and {zip_path.name}."
821
826
  assert state.data.save_as_zip is False
822
827
 
823
828
 
@@ -845,18 +850,21 @@ async def test_zip_save_flag(tmp_path: Path) -> None:
845
850
  zip_path = tmp_path / f"{DUMMY_SLUG}.zip"
846
851
  bindings["c-s"](mock_event)
847
852
  assert _step(state) == AppStep.INDEX
848
- assert state.status == f"Files saved to {zip_path}."
853
+ assert state.status == f"Files saved to {tmp_path} and {zip_path.name}."
849
854
  assert state.data.save_as_zip is False
855
+ assert (tmp_path / f"pyplumio/parameters/custom/{DUMMY_SLUG}.py").is_file()
850
856
  assert zip_path.is_file()
851
857
 
852
- # Second Ctrl+S goes directly to OVERWRITE for the ZIP file
858
+ # Second Ctrl+S goes directly to OVERWRITE for both regular module and ZIP file
853
859
  bindings["c-s"](mock_event)
854
860
  assert _step(state) == AppStep.OVERWRITE
855
- assert state.prompt == f"Overwrite existing {DUMMY_SLUG}.zip? [y/N]: "
861
+ assert state.prompt == (
862
+ f"Overwrite existing {DUMMY_SLUG}.py and {DUMMY_SLUG}.zip? [y/N]: "
863
+ )
856
864
  app_buffer.text = "y"
857
865
  state.dispatch_enter(app_buffer)
858
866
  assert _step(state) == AppStep.INDEX
859
- assert state.status == f"Files saved to {zip_path}."
867
+ assert state.status == f"Files saved to {tmp_path} and {zip_path.name}."
860
868
  assert state.data.save_as_zip is False
861
869
 
862
870
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes