PyPlumIO 0.7.2__tar.gz → 0.7.4__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 (139) hide show
  1. {pyplumio-0.7.2 → pyplumio-0.7.4}/PKG-INFO +1 -1
  2. {pyplumio-0.7.2 → pyplumio-0.7.4}/docs/source/frames.rst +15 -15
  3. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/const.py +8 -6
  4. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/devices/ecomax.py +31 -16
  5. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/filters.py +8 -12
  6. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/frames/requests.py +10 -10
  7. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/frames/responses.py +14 -14
  8. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/helpers/async_cache.py +6 -3
  9. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/parameters/custom/__init__.py +42 -26
  10. pyplumio-0.7.4/pyplumio/parameters/custom/ecomax_350p2_zf.py +76 -0
  11. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/parameters/custom/ecomax_860d3_hb.py +14 -14
  12. pyplumio-0.7.4/pyplumio/parameters/custom/ecomax_860p4_nm_touch.py +301 -0
  13. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/parameters/ecomax.py +36 -306
  14. pyplumio-0.7.2/pyplumio/structures/ecomax_extended_parameters.py → pyplumio-0.7.4/pyplumio/structures/ecomax_service_parameters.py +9 -9
  15. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyproject.toml +1 -1
  16. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/conftest.py +4 -4
  17. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/devices/test_ecomax.py +64 -124
  18. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/devices/test_mixer.py +1 -1
  19. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/frames/test_requests.py +16 -16
  20. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/frames/test_responses.py +6 -6
  21. pyplumio-0.7.4/tests/parameters/custom/test_ecomax_350p2_zf.py +100 -0
  22. pyplumio-0.7.4/tests/parameters/custom/test_ecomax_860d3_hb.py +73 -0
  23. pyplumio-0.7.4/tests/parameters/custom/test_ecomax_860p4_nm_touch.py +148 -0
  24. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/parameters/custom/test_init.py +18 -10
  25. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/parameters/test_ecomax.py +37 -11
  26. pyplumio-0.7.4/tests/structures/test_ecomax_service_parameters.py +51 -0
  27. pyplumio-0.7.4/tests/testdata/parameters/ecomax_350p2_zf.json +19 -0
  28. pyplumio-0.7.4/tests/testdata/parameters/ecomax_860p4_nm_touch.json +29 -0
  29. pyplumio-0.7.2/tests/testdata/requests/ecomax_extended_parameters.json → pyplumio-0.7.4/tests/testdata/requests/ecomax_service_parameters.json +1 -1
  30. pyplumio-0.7.2/tests/testdata/responses/ecomax_extended_parameters.json → pyplumio-0.7.4/tests/testdata/responses/ecomax_service_parameters.json +2 -2
  31. pyplumio-0.7.2/tests/parameters/custom/test_ecomax_860d3_hb.py +0 -90
  32. pyplumio-0.7.2/tests/structures/test_ecomax_extended_parameters.py +0 -51
  33. {pyplumio-0.7.2 → pyplumio-0.7.4}/.gitignore +0 -0
  34. {pyplumio-0.7.2 → pyplumio-0.7.4}/LICENSE +0 -0
  35. {pyplumio-0.7.2 → pyplumio-0.7.4}/README.md +0 -0
  36. {pyplumio-0.7.2 → pyplumio-0.7.4}/docs/Makefile +0 -0
  37. {pyplumio-0.7.2 → pyplumio-0.7.4}/docs/make.bat +0 -0
  38. {pyplumio-0.7.2 → pyplumio-0.7.4}/docs/source/callbacks.rst +0 -0
  39. {pyplumio-0.7.2 → pyplumio-0.7.4}/docs/source/conf.py +0 -0
  40. {pyplumio-0.7.2 → pyplumio-0.7.4}/docs/source/connecting.rst +0 -0
  41. {pyplumio-0.7.2 → pyplumio-0.7.4}/docs/source/index.rst +0 -0
  42. {pyplumio-0.7.2 → pyplumio-0.7.4}/docs/source/mixers_thermostats.rst +0 -0
  43. {pyplumio-0.7.2 → pyplumio-0.7.4}/docs/source/protocol.rst +0 -0
  44. {pyplumio-0.7.2 → pyplumio-0.7.4}/docs/source/reading.rst +0 -0
  45. {pyplumio-0.7.2 → pyplumio-0.7.4}/docs/source/schedules.rst +0 -0
  46. {pyplumio-0.7.2 → pyplumio-0.7.4}/docs/source/writing.rst +0 -0
  47. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/__init__.py +0 -0
  48. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/__main__.py +0 -0
  49. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/connection.py +0 -0
  50. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/data_types.py +0 -0
  51. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/devices/__init__.py +0 -0
  52. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/devices/ecoster.py +0 -0
  53. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/devices/mixer.py +0 -0
  54. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/devices/thermostat.py +0 -0
  55. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/exceptions.py +0 -0
  56. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/frames/__init__.py +0 -0
  57. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/frames/messages.py +0 -0
  58. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/helpers/__init__.py +0 -0
  59. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/helpers/event_manager.py +0 -0
  60. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/helpers/task_manager.py +0 -0
  61. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/parameters/__init__.py +0 -0
  62. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/parameters/mixer.py +0 -0
  63. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/parameters/thermostat.py +0 -0
  64. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/protocol.py +0 -0
  65. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/py.typed +0 -0
  66. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/stream.py +0 -0
  67. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/structures/__init__.py +0 -0
  68. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/structures/alerts.py +0 -0
  69. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/structures/ecomax_parameters.py +0 -0
  70. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/structures/frame_versions.py +0 -0
  71. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/structures/mixer_parameters.py +0 -0
  72. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/structures/network_info.py +0 -0
  73. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/structures/product_info.py +0 -0
  74. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/structures/program_version.py +0 -0
  75. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/structures/regulator_data.py +0 -0
  76. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/structures/regulator_data_schema.py +0 -0
  77. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/structures/schedules.py +0 -0
  78. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/structures/sensor_data.py +0 -0
  79. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/structures/thermostat_parameters.py +0 -0
  80. {pyplumio-0.7.2 → pyplumio-0.7.4}/pyplumio/utils.py +0 -0
  81. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/__init__.py +0 -0
  82. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/devices/__init__.py +0 -0
  83. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/devices/test_ecoster.py +0 -0
  84. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/devices/test_init.py +0 -0
  85. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/devices/test_thermostat.py +0 -0
  86. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/frames/test_init.py +0 -0
  87. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/frames/test_messages.py +0 -0
  88. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/helpers/__init__.py +0 -0
  89. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/helpers/test_async_cache.py +0 -0
  90. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/helpers/test_event_manager.py +0 -0
  91. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/helpers/test_task_manager.py +0 -0
  92. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/helpers/test_uid.py +0 -0
  93. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/parameters/__init__.py +0 -0
  94. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/parameters/custom/__init__.py +0 -0
  95. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/parameters/test_init.py +0 -0
  96. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/parameters/test_mixers.py +0 -0
  97. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/parameters/test_thermostats.py +0 -0
  98. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/ruff.toml +0 -0
  99. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/structures/__init__.py +0 -0
  100. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/structures/test_alerts.py +0 -0
  101. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/structures/test_ecomax_parameters.py +0 -0
  102. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/structures/test_frame_versions.py +0 -0
  103. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/structures/test_mixer_parameters.py +0 -0
  104. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/structures/test_product_info.py +0 -0
  105. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/structures/test_program_version.py +0 -0
  106. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/structures/test_schedules.py +0 -0
  107. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/test_connection.py +0 -0
  108. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/test_data_types.py +0 -0
  109. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/test_filters.py +0 -0
  110. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/test_init.py +0 -0
  111. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/test_main.py +0 -0
  112. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/test_protocol.py +0 -0
  113. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/test_stream.py +0 -0
  114. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/test_utils.py +0 -0
  115. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/messages/regulator_data.json +0 -0
  116. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/messages/sensor_data.json +0 -0
  117. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/parameters/ecomax_860d3_hb.json +0 -0
  118. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/requests/alerts.json +0 -0
  119. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/requests/ecomax_control.json +0 -0
  120. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/requests/ecomax_parameters.json +0 -0
  121. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/requests/mixer_parameters.json +0 -0
  122. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/requests/set_ecomax_parameter.json +0 -0
  123. /pyplumio-0.7.2/tests/testdata/requests/set_ecomax_extended_parameter.json → /pyplumio-0.7.4/tests/testdata/requests/set_ecomax_service_parameter.json +0 -0
  124. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/requests/set_mixer_parameter.json +0 -0
  125. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/requests/set_schedule.json +0 -0
  126. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/requests/set_thermostat_parameter.json +0 -0
  127. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/requests/thermostat_parameters.json +0 -0
  128. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/responses/alerts.json +0 -0
  129. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/responses/device_available.json +0 -0
  130. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/responses/ecomax_parameters.json +0 -0
  131. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/responses/mixer_parameters.json +0 -0
  132. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/responses/password.json +0 -0
  133. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/responses/program_version.json +0 -0
  134. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/responses/regulator_data_schema.json +0 -0
  135. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/responses/schedules.json +0 -0
  136. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/responses/thermostat_parameters.json +0 -0
  137. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/responses/uid.json +0 -0
  138. {pyplumio-0.7.2 → pyplumio-0.7.4}/tests/testdata/unknown/unknown_ecomax_parameter.json +0 -0
  139. {pyplumio-0.7.2 → pyplumio-0.7.4}/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.2
3
+ Version: 0.7.4
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
@@ -99,10 +99,10 @@ Handler
99
99
 
100
100
  .. autoclass:: pyplumio.structures.ecomax_parameters.EcomaxParametersStructure
101
101
 
102
- EcomaxExtendedParameters
103
- ------------------------
102
+ EcomaxServiceParameters
103
+ -----------------------
104
104
 
105
- Get the ecoMAX controller editable parameters from the extended parameter
105
+ Get the ecoMAX controller editable parameters from the service parameter
106
106
  table. Newer controllers, such as ecoMAX 860P4-NM TOUCH, keep part of their
107
107
  settings only in this table.
108
108
 
@@ -111,14 +111,14 @@ in the frame version table, and requests it again each time its version
111
111
  changes.
112
112
 
113
113
  Parameters are represented in the same way as in :ref:`ecomaxparameters`.
114
- Raw parameters are available under the ``ecomax_extended_parameters`` key.
114
+ Raw parameters are available under the ``ecomax_service_parameters`` key.
115
115
  Parameters with known meaning are also available by name for verified
116
116
  products only.
117
117
 
118
118
  Request
119
119
  ^^^^^^^
120
120
 
121
- .. autoattribute:: pyplumio.const.FrameType.REQUEST_ECOMAX_EXTENDED_PARAMETERS
121
+ .. autoattribute:: pyplumio.const.FrameType.REQUEST_ECOMAX_SERVICE_PARAMETERS
122
122
 
123
123
  .. list-table::
124
124
  :widths: 20 65 10
@@ -137,7 +137,7 @@ Request
137
137
  Response
138
138
  ^^^^^^^^
139
139
 
140
- .. autoattribute:: pyplumio.const.FrameType.RESPONSE_ECOMAX_EXTENDED_PARAMETERS
140
+ .. autoattribute:: pyplumio.const.FrameType.RESPONSE_ECOMAX_SERVICE_PARAMETERS
141
141
 
142
142
  .. list-table::
143
143
  :widths: 50 50
@@ -145,13 +145,13 @@ Response
145
145
 
146
146
  * - Name
147
147
  - Description
148
- * - ecomax_extended_parameters
149
- - Contains a list of ecomax extended parameters.
148
+ * - ecomax_service_parameters
149
+ - Contains a list of ecomax service parameters.
150
150
 
151
151
  Handler
152
152
  ^^^^^^^
153
153
 
154
- .. autoclass:: pyplumio.structures.ecomax_extended_parameters.EcomaxExtendedParametersStructure
154
+ .. autoclass:: pyplumio.structures.ecomax_service_parameters.EcomaxServiceParametersStructure
155
155
 
156
156
  MixerParameters
157
157
  ---------------
@@ -228,10 +228,10 @@ Response
228
228
 
229
229
  .. autoattribute:: pyplumio.const.FrameType.RESPONSE_SET_ECOMAX_PARAMETER
230
230
 
231
- SetEcomaxExtendedParameter
232
- --------------------------
231
+ SetEcomaxServiceParameter
232
+ -------------------------
233
233
 
234
- Set the editable parameter value in the extended parameter table.
234
+ Set the editable parameter value in the service parameter table.
235
235
 
236
236
  The message is the number of values, the index of the first parameter and
237
237
  the new raw values for consecutive indexes. In a panel capture, a single
@@ -241,13 +241,13 @@ parameter per frame.
241
241
 
242
242
  In captures, after every panel write the controller increased the frame
243
243
  type 97 version in the regulator data frame version table within 1-3 seconds
244
- (6, 7, 8, 9, 10, 11 for five writes), so PyPlumIO re-reads the extended
244
+ (6, 7, 8, 9, 10, 11 for five writes), so PyPlumIO re-reads the service
245
245
  parameter table and confirms the set from it.
246
246
 
247
247
  Request
248
248
  ^^^^^^^
249
249
 
250
- .. autoattribute:: pyplumio.const.FrameType.REQUEST_SET_ECOMAX_EXTENDED_PARAMETER
250
+ .. autoattribute:: pyplumio.const.FrameType.REQUEST_SET_ECOMAX_SERVICE_PARAMETER
251
251
 
252
252
  .. list-table::
253
253
  :widths: 20 65 10
@@ -266,7 +266,7 @@ Request
266
266
  Response
267
267
  ^^^^^^^^
268
268
 
269
- .. autoattribute:: pyplumio.const.FrameType.RESPONSE_SET_ECOMAX_EXTENDED_PARAMETER
269
+ .. autoattribute:: pyplumio.const.FrameType.RESPONSE_SET_ECOMAX_SERVICE_PARAMETER
270
270
 
271
271
  SetMixerParameter
272
272
  -----------------
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from enum import Enum, IntEnum, unique
5
+ from enum import IntEnum, StrEnum, unique
6
6
  from typing import Any, Final, Literal, TypeAlias
7
7
 
8
8
  # General attributes.
@@ -26,6 +26,8 @@ ATTR_SIZE: Final = "size"
26
26
  # Bytes.
27
27
  BYTE_UNDEFINED: Final = 0xFF
28
28
 
29
+ UNDEFINED: Final = object()
30
+
29
31
 
30
32
  @unique
31
33
  class EncryptionType(IntEnum):
@@ -179,8 +181,8 @@ class FrameType(IntEnum):
179
181
  REQUEST_REGULATOR_DATA_SCHEMA = 85
180
182
  REQUEST_THERMOSTAT_PARAMETERS = 92
181
183
  REQUEST_SET_THERMOSTAT_PARAMETER = 93
182
- REQUEST_ECOMAX_EXTENDED_PARAMETERS = 97
183
- REQUEST_SET_ECOMAX_EXTENDED_PARAMETER = 112
184
+ REQUEST_ECOMAX_SERVICE_PARAMETERS = 97
185
+ REQUEST_SET_ECOMAX_SERVICE_PARAMETER = 112
184
186
  RESPONSE_DEVICE_AVAILABLE = 176
185
187
  RESPONSE_ECOMAX_PARAMETERS = 177
186
188
  RESPONSE_MIXER_PARAMETERS = 178
@@ -196,14 +198,14 @@ class FrameType(IntEnum):
196
198
  RESPONSE_REGULATOR_DATA_SCHEMA = 213
197
199
  RESPONSE_THERMOSTAT_PARAMETERS = 220
198
200
  RESPONSE_SET_THERMOSTAT_PARAMETER = 221
199
- RESPONSE_ECOMAX_EXTENDED_PARAMETERS = 225
200
- RESPONSE_SET_ECOMAX_EXTENDED_PARAMETER = 240
201
+ RESPONSE_ECOMAX_SERVICE_PARAMETERS = 225
202
+ RESPONSE_SET_ECOMAX_SERVICE_PARAMETER = 240
201
203
  MESSAGE_REGULATOR_DATA = 8
202
204
  MESSAGE_SENSOR_DATA = 53
203
205
 
204
206
 
205
207
  @unique
206
- class UnitOfMeasurement(Enum):
208
+ class UnitOfMeasurement(StrEnum):
207
209
  """Contains units of measurement."""
208
210
 
209
211
  CELSIUS = "°C"
@@ -30,13 +30,14 @@ from pyplumio.helpers.event_manager import event_listener
30
30
  from pyplumio.parameters import ParameterValues
31
31
  from pyplumio.parameters.ecomax import (
32
32
  ECOMAX_CONTROL_PARAMETER,
33
- EXTENDED_PARAMETER_TYPES,
34
33
  THERMOSTAT_PROFILE_PARAMETER,
35
- EcomaxExtendedNumber,
36
34
  EcomaxNumber,
35
+ EcomaxServiceNumber,
36
+ EcomaxServiceSwitch,
37
37
  EcomaxSwitch,
38
38
  EcomaxSwitchDescription,
39
39
  get_ecomax_parameter_types,
40
+ get_service_parameter_types,
40
41
  )
41
42
  from pyplumio.structures.alerts import ATTR_TOTAL_ALERTS
42
43
  from pyplumio.structures.ecomax_parameters import (
@@ -313,30 +314,44 @@ class EcoMAX(PhysicalDevice):
313
314
  return True
314
315
 
315
316
  @event_listener
316
- async def on_event_ecomax_extended_parameters(
317
+ async def on_event_ecomax_service_parameters(
317
318
  self, parameters: list[tuple[int, ParameterValues]]
318
319
  ) -> None:
319
- """Update ecoMAX extended parameters and dispatch the events.
320
+ """Update ecoMAX service parameters and dispatch the events.
320
321
 
321
322
  Raw parameter values are kept under the original event name.
322
323
  """
323
- _LOGGER.debug("Received device extended parameters")
324
+ _LOGGER.debug("Received device service parameters")
324
325
  product_info = await self.get(ATTR_PRODUCT)
325
- parameter_types = EXTENDED_PARAMETER_TYPES.get(
326
- (product_info.id, product_info.model), {}
327
- )
328
- await asyncio.gather(
329
- *(
330
- self.dispatch(
326
+ if not (parameter_types := await get_service_parameter_types(product_info)):
327
+ _LOGGER.debug(
328
+ "Encountered unknown ecoMAX service parameter table. "
329
+ "Your device isn't fully compatible with this software "
330
+ "and may not work properly. Please visit the issue tracker "
331
+ "and open a feature request to support %s",
332
+ product_info.model,
333
+ )
334
+ return
335
+
336
+ def _ecomax_service_parameter_events() -> Generator[Coroutine[Any, Any, None]]:
337
+ """Get dispatch calls for ecoMAX service parameter events."""
338
+ for index, values in parameters:
339
+ if not (description := parameter_types.get(index, None)):
340
+ continue
341
+
342
+ handler = (
343
+ EcomaxServiceSwitch
344
+ if isinstance(description, EcomaxSwitchDescription)
345
+ else EcomaxServiceNumber
346
+ )
347
+ yield self.dispatch(
331
348
  description.name,
332
- EcomaxExtendedNumber.create_or_update(
349
+ handler.create_or_update(
333
350
  device=self, description=description, values=values, index=index
334
351
  ),
335
352
  )
336
- for index, values in parameters
337
- if (description := parameter_types.get(index))
338
- )
339
- )
353
+
354
+ await asyncio.gather(*_ecomax_service_parameter_events())
340
355
 
341
356
  @event_listener
342
357
  async def on_event_fuel_consumption(self, fuel_consumption: float) -> None:
@@ -22,6 +22,7 @@ from typing import (
22
22
  runtime_checkable,
23
23
  )
24
24
 
25
+ from pyplumio.const import UNDEFINED
25
26
  from pyplumio.helpers.event_manager import EventCallback
26
27
  from pyplumio.parameters import Number, Parameter
27
28
 
@@ -35,9 +36,6 @@ with suppress(ImportError):
35
36
  numpy_installed = True
36
37
 
37
38
 
38
- UNDEFINED: Final = "undefined"
39
-
40
-
41
39
  @runtime_checkable
42
40
  class SupportsSubtraction(Protocol):
43
41
  """Supports subtraction operation."""
@@ -92,14 +90,12 @@ def is_close(
92
90
  return False
93
91
 
94
92
  if isinstance(old, Parameter) and isinstance(new, Parameter):
95
- if (
96
- tolerance
97
- and isinstance(old, Number)
98
- and isinstance(new, Number)
99
- and old.values.min_value == new.values.min_value
100
- and old.values.max_value == new.values.max_value
101
- ):
102
- return math.isclose(old, new, abs_tol=tolerance)
93
+ if tolerance and isinstance(old, Number) and isinstance(new, Number):
94
+ return (
95
+ old.values.min_value == new.values.min_value
96
+ and old.values.max_value == new.values.max_value
97
+ and math.isclose(old, new, abs_tol=tolerance)
98
+ )
103
99
 
104
100
  return old.values.__eq__(new.values)
105
101
 
@@ -432,7 +428,7 @@ class ComparisonFilter(Filter):
432
428
 
433
429
  def is_undefined(self) -> bool:
434
430
  """Check if current value is undefined."""
435
- return True if self._value == UNDEFINED else False
431
+ return self._value is UNDEFINED
436
432
 
437
433
  @property
438
434
  def value(self) -> Any:
@@ -82,10 +82,10 @@ class EcomaxParametersRequest(Request):
82
82
  return bytes([data.get(ATTR_COUNT, 255), data.get(ATTR_START, 0)])
83
83
 
84
84
 
85
- @frame_handler(FrameType.REQUEST_ECOMAX_EXTENDED_PARAMETERS)
86
- @expects_response(responses.EcomaxExtendedParametersResponse)
87
- class EcomaxExtendedParametersRequest(EcomaxParametersRequest):
88
- """Represents an ecoMAX extended parameters request.
85
+ @frame_handler(FrameType.REQUEST_ECOMAX_SERVICE_PARAMETERS)
86
+ @expects_response(responses.EcomaxServiceParametersResponse)
87
+ class EcomaxServiceParametersRequest(EcomaxParametersRequest):
88
+ """Represents an ecoMAX service parameters request.
89
89
 
90
90
  Contains number of parameters and index of the first parameter.
91
91
  """
@@ -159,10 +159,10 @@ class SetEcomaxParameterRequest(Request):
159
159
  raise FrameDataError from e
160
160
 
161
161
 
162
- @frame_handler(FrameType.REQUEST_SET_ECOMAX_EXTENDED_PARAMETER)
163
- @expects_response(responses.SetEcomaxExtendedParameterResponse)
164
- class SetEcomaxExtendedParameterRequest(Request):
165
- """Represents a request to set an ecoMAX extended parameter.
162
+ @frame_handler(FrameType.REQUEST_SET_ECOMAX_SERVICE_PARAMETER)
163
+ @expects_response(responses.SetEcomaxServiceParameterResponse)
164
+ class SetEcomaxServiceParameterRequest(Request):
165
+ """Represents a request to set an ecoMAX service parameter.
166
166
 
167
167
  Contains the number of values, the first parameter index and the
168
168
  new values for consecutive indexes. Only one value is sent.
@@ -299,15 +299,15 @@ __all__ = [
299
299
  "AlertsRequest",
300
300
  "CheckDeviceRequest",
301
301
  "EcomaxControlRequest",
302
- "EcomaxExtendedParametersRequest",
303
302
  "EcomaxParametersRequest",
303
+ "EcomaxServiceParametersRequest",
304
304
  "MixerParametersRequest",
305
305
  "PasswordRequest",
306
306
  "ProgramVersionRequest",
307
307
  "RegulatorDataSchemaRequest",
308
308
  "SchedulesRequest",
309
- "SetEcomaxExtendedParameterRequest",
310
309
  "SetEcomaxParameterRequest",
310
+ "SetEcomaxServiceParameterRequest",
311
311
  "SetMixerParameterRequest",
312
312
  "SetScheduleRequest",
313
313
  "SetThermostatParameterRequest",
@@ -7,10 +7,10 @@ from typing import Any
7
7
  from pyplumio.const import ATTR_PASSWORD, FrameType
8
8
  from pyplumio.frames import Response, contains, frame_handler
9
9
  from pyplumio.structures.alerts import AlertsStructure
10
- from pyplumio.structures.ecomax_extended_parameters import (
11
- EcomaxExtendedParametersStructure,
12
- )
13
10
  from pyplumio.structures.ecomax_parameters import EcomaxParametersStructure
11
+ from pyplumio.structures.ecomax_service_parameters import (
12
+ EcomaxServiceParametersStructure,
13
+ )
14
14
  from pyplumio.structures.mixer_parameters import MixerParametersStructure
15
15
  from pyplumio.structures.network_info import NetworkInfoStructure
16
16
  from pyplumio.structures.product_info import ProductInfoStructure
@@ -50,12 +50,12 @@ class EcomaxControlResponse(Response):
50
50
  __slots__ = ()
51
51
 
52
52
 
53
- @frame_handler(FrameType.RESPONSE_ECOMAX_EXTENDED_PARAMETERS)
54
- @contains(EcomaxExtendedParametersStructure)
55
- class EcomaxExtendedParametersResponse(Response):
56
- """Represents an ecoMAX extended parameters response.
53
+ @frame_handler(FrameType.RESPONSE_ECOMAX_SERVICE_PARAMETERS)
54
+ @contains(EcomaxServiceParametersStructure)
55
+ class EcomaxServiceParametersResponse(Response):
56
+ """Represents an ecoMAX service parameters response.
57
57
 
58
- Contains editable ecoMAX parameters from the extended parameter
58
+ Contains editable ecoMAX parameters from the service parameter
59
59
  table, that is used by newer controllers alongside the regular
60
60
  one.
61
61
  """
@@ -131,11 +131,11 @@ class SchedulesResponse(Response):
131
131
  __slots__ = ()
132
132
 
133
133
 
134
- @frame_handler(FrameType.RESPONSE_SET_ECOMAX_EXTENDED_PARAMETER)
135
- class SetEcomaxExtendedParameterResponse(Response):
136
- """Represents response to a set ecoMAX extended parameter request.
134
+ @frame_handler(FrameType.RESPONSE_SET_ECOMAX_SERVICE_PARAMETER)
135
+ class SetEcomaxServiceParameterResponse(Response):
136
+ """Represents response to a set ecoMAX service parameter request.
137
137
 
138
- Empty response acknowledges, that ecoMAX extended parameter was
138
+ Empty response acknowledges, that ecoMAX service parameter was
139
139
  successfully set.
140
140
  """
141
141
 
@@ -201,15 +201,15 @@ __all__ = [
201
201
  "AlertsResponse",
202
202
  "DeviceAvailableResponse",
203
203
  "EcomaxControlResponse",
204
- "EcomaxExtendedParametersResponse",
205
204
  "EcomaxParametersResponse",
205
+ "EcomaxServiceParametersResponse",
206
206
  "MixerParametersResponse",
207
207
  "PasswordResponse",
208
208
  "ProgramVersionResponse",
209
209
  "RegulatorDataSchemaResponse",
210
210
  "SchedulesResponse",
211
- "SetEcomaxExtendedParameterResponse",
212
211
  "SetEcomaxParameterResponse",
212
+ "SetEcomaxServiceParameterResponse",
213
213
  "SetMixerParameterResponse",
214
214
  "SetThermostatParameterResponse",
215
215
  "ThermostatParametersResponse",
@@ -7,6 +7,8 @@ from functools import wraps
7
7
  from types import MappingProxyType
8
8
  from typing import Any, ParamSpec, TypeVar, cast
9
9
 
10
+ from pyplumio.const import UNDEFINED
11
+
10
12
  T = TypeVar("T")
11
13
  P = ParamSpec("P")
12
14
 
@@ -24,10 +26,11 @@ class AsyncCache:
24
26
 
25
27
  async def get(self, key: str, coro: Callable[..., Awaitable[Any]]) -> Any:
26
28
  """Get a value from the cache or compute and store it."""
27
- if key not in self.cache:
28
- self._cache[key] = await coro()
29
+ if (cached_value := self._cache.get(key, UNDEFINED)) is not UNDEFINED:
30
+ return cached_value
29
31
 
30
- return self._cache[key]
32
+ self._cache[key] = cached_value = await coro()
33
+ return cached_value
31
34
 
32
35
  @property
33
36
  def cache(self) -> MappingProxyType[str, Any]:
@@ -5,8 +5,9 @@ from __future__ import annotations
5
5
  from collections.abc import Sequence
6
6
  from dataclasses import dataclass
7
7
  import logging
8
- from typing import ClassVar, TypeVar, cast
8
+ from typing import ClassVar, NamedTuple, TypeVar, cast
9
9
 
10
+ from pyplumio.helpers.async_cache import acache
10
11
  from pyplumio.parameters import ParameterDescription
11
12
  from pyplumio.structures.product_info import ProductInfo
12
13
  from pyplumio.utils import create_instance, to_camelcase
@@ -22,9 +23,8 @@ class Signature:
22
23
  model: str
23
24
 
24
25
 
25
- @dataclass(slots=True, kw_only=True)
26
- class CustomParameter:
27
- """Represents a custom parameter."""
26
+ class ParameterOverride(NamedTuple):
27
+ """Represents a parameter override."""
28
28
 
29
29
  original: str
30
30
  replacement: ParameterDescription
@@ -35,8 +35,14 @@ class CustomParameters:
35
35
 
36
36
  __slots__ = ()
37
37
 
38
+ # Device signature.
38
39
  signature: ClassVar[Signature]
39
- replacements: ClassVar[Sequence[CustomParameter]]
40
+
41
+ # Overrides descriptions in standard parameter table.
42
+ overrides: ClassVar[Sequence[ParameterOverride]] = []
43
+
44
+ # Service parameters descriptions.
45
+ descriptions: ClassVar[dict[int, ParameterDescription]] = {}
40
46
 
41
47
  def validate(self, product_info: ProductInfo) -> bool:
42
48
  """Validate the product info."""
@@ -46,9 +52,10 @@ class CustomParameters:
46
52
  )
47
53
 
48
54
 
55
+ @acache
49
56
  async def _load_custom_parameters(
50
57
  product_info: ProductInfo,
51
- ) -> dict[str, ParameterDescription] | None:
58
+ ) -> CustomParameters | None:
52
59
  """Load custom parameters."""
53
60
  module_name = product_info.model.replace("-", "_").replace(" ", "_").lower()
54
61
  module_path = f"parameters.custom.{module_name}"
@@ -67,40 +74,49 @@ async def _load_custom_parameters(
67
74
  _LOGGER.debug("No custom parameters found for %s", product_info.model)
68
75
  return None
69
76
 
70
- return {
71
- custom_parameter.original: custom_parameter.replacement
72
- for custom_parameter in custom_parameters.replacements
73
- }
77
+ _LOGGER.debug("Custom parameters loaded for %s", product_info.model)
78
+ return custom_parameters
74
79
 
75
80
 
76
81
  _DescriptionT = TypeVar("_DescriptionT", bound=ParameterDescription)
77
82
 
78
83
 
79
- async def inject_custom_parameters(
84
+ async def get_custom_service_parameter_types(
85
+ product_info: ProductInfo,
86
+ ) -> dict[int, ParameterDescription]:
87
+ """Get custom service parameter types."""
88
+ if custom_parameters := await _load_custom_parameters(product_info):
89
+ return custom_parameters.descriptions
90
+
91
+ return {}
92
+
93
+
94
+ async def inject_custom_parameter_overrides(
80
95
  product_info: ProductInfo, parameter_types: list[_DescriptionT]
81
96
  ) -> list[_DescriptionT]:
82
97
  """Patch the parameter types based on the provided overrides."""
83
98
  if custom_parameters := await _load_custom_parameters(product_info):
84
- _LOGGER.debug("Custom parameters found for %s", product_info.model)
85
- return cast(
86
- list[_DescriptionT],
87
- [
88
- replacement
89
- if original.name in custom_parameters
90
- and (replacement := custom_parameters[original.name])
91
- and (base_class := original.__class__.__bases__[0])
92
- and isinstance(replacement, base_class)
93
- else original
94
- for original in parameter_types
95
- ],
96
- )
99
+ if overrides := dict(custom_parameters.overrides):
100
+ return cast(
101
+ list[_DescriptionT],
102
+ [
103
+ replacement
104
+ if original.name in overrides
105
+ and (replacement := overrides[original.name])
106
+ and (base_class := original.__class__.__bases__[0])
107
+ and isinstance(replacement, base_class)
108
+ else original
109
+ for original in parameter_types
110
+ ],
111
+ )
97
112
 
98
113
  return parameter_types
99
114
 
100
115
 
101
116
  __all__ = (
102
- "inject_custom_parameters",
103
117
  "CustomParameters",
104
- "CustomParameter",
118
+ "ParameterOverride",
105
119
  "Signature",
120
+ "get_custom_service_parameter_types",
121
+ "inject_custom_parameter_overrides",
106
122
  )
@@ -0,0 +1,76 @@
1
+ """Contains patch for ecoMAX 350P2-ZF."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from pyplumio.const import PERCENTAGE, UnitOfMeasurement
6
+ from pyplumio.parameters.custom import CustomParameters, Signature
7
+ from pyplumio.parameters.ecomax import EcomaxNumberDescription, EcomaxSwitchDescription
8
+
9
+
10
+ class EcoMAX350P2ZF(CustomParameters):
11
+ """Custom parameters for ecoMAX 350P2-ZF."""
12
+
13
+ signature = Signature(model="ecoMAX 350P2-ZF", id=90)
14
+
15
+ descriptions = {
16
+ 8: EcomaxNumberDescription(
17
+ name="heating_cycle_time",
18
+ unit_of_measurement=UnitOfMeasurement.SECONDS,
19
+ ),
20
+ 12: EcomaxNumberDescription(name="fuzzy_logic_parameter_a"),
21
+ 13: EcomaxNumberDescription(name="fuzzy_logic_parameter_b"),
22
+ 14: EcomaxNumberDescription(name="fuzzy_logic_parameter_c"),
23
+ 16: EcomaxNumberDescription(
24
+ name="ignition_fan_power", unit_of_measurement=PERCENTAGE
25
+ ),
26
+ 17: EcomaxNumberDescription(
27
+ name="ignition_fuel_detection_time",
28
+ unit_of_measurement=UnitOfMeasurement.SECONDS,
29
+ ),
30
+ 19: EcomaxNumberDescription(
31
+ name="ignition_fuel_dose", unit_of_measurement=UnitOfMeasurement.GRAMS
32
+ ),
33
+ 20: EcomaxNumberDescription(
34
+ name="ignition_flue_gas_temp", unit_of_measurement=UnitOfMeasurement.CELSIUS
35
+ ),
36
+ 21: EcomaxNumberDescription(
37
+ name="ignition_low_power_time",
38
+ unit_of_measurement=UnitOfMeasurement.MINUTES,
39
+ ),
40
+ 22: EcomaxNumberDescription(
41
+ name="stabilization_fan_power", unit_of_measurement=PERCENTAGE
42
+ ),
43
+ 23: EcomaxNumberDescription(
44
+ name="stabilization_min_flue_gas_temp",
45
+ unit_of_measurement=UnitOfMeasurement.CELSIUS,
46
+ ),
47
+ 24: EcomaxNumberDescription(
48
+ name="stabilization_fan_work_time",
49
+ unit_of_measurement=UnitOfMeasurement.MINUTES,
50
+ ),
51
+ 25: EcomaxNumberDescription(
52
+ name="stabilization_temp_delta",
53
+ unit_of_measurement=UnitOfMeasurement.CELSIUS,
54
+ ),
55
+ 28: EcomaxNumberDescription(
56
+ name="minimum_allowed_fan_power", unit_of_measurement=PERCENTAGE
57
+ ),
58
+ 39: EcomaxNumberDescription(name="feeder_coefficient", step=0.1),
59
+ 41: EcomaxNumberDescription(
60
+ name="hopper_capacity", unit_of_measurement=UnitOfMeasurement.KILOGRAMS
61
+ ),
62
+ 47: EcomaxNumberDescription(
63
+ name="lower_heating_temp_from_thermostat",
64
+ unit_of_measurement=UnitOfMeasurement.CELSIUS,
65
+ ),
66
+ 86: EcomaxNumberDescription(
67
+ name="boiler_cooling_temp", unit_of_measurement=UnitOfMeasurement.CELSIUS
68
+ ),
69
+ 87: EcomaxSwitchDescription(name="thermostat_mode_switch"),
70
+ 111: EcomaxNumberDescription(
71
+ name="feeder2_work_time_extension",
72
+ unit_of_measurement=UnitOfMeasurement.SECONDS,
73
+ ),
74
+ # 0 - pellets, 1 - wood
75
+ 113: EcomaxNumberDescription(name="fuel_selector"),
76
+ }