PyPlumIO 0.5.41__tar.gz → 0.5.42__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 (142) hide show
  1. {pyplumio-0.5.41 → pyplumio-0.5.42}/PKG-INFO +1 -1
  2. {pyplumio-0.5.41 → pyplumio-0.5.42}/PyPlumIO.egg-info/PKG-INFO +1 -1
  3. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/_version.py +2 -2
  4. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/helpers/parameter.py +13 -4
  5. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/ecomax_parameters.py +3 -17
  6. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/mixer_parameters.py +3 -17
  7. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/thermostat_parameters.py +1 -23
  8. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/helpers/test_parameter.py +2 -1
  9. {pyplumio-0.5.41 → pyplumio-0.5.42}/.gitattributes +0 -0
  10. {pyplumio-0.5.41 → pyplumio-0.5.42}/.github/CODE_OF_CONDUCT.md +0 -0
  11. {pyplumio-0.5.41 → pyplumio-0.5.42}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  12. {pyplumio-0.5.41 → pyplumio-0.5.42}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  13. {pyplumio-0.5.41 → pyplumio-0.5.42}/.github/dependabot.yml +0 -0
  14. {pyplumio-0.5.41 → pyplumio-0.5.42}/.github/workflows/ci.yml +0 -0
  15. {pyplumio-0.5.41 → pyplumio-0.5.42}/.github/workflows/codeql-analysis.yml +0 -0
  16. {pyplumio-0.5.41 → pyplumio-0.5.42}/.github/workflows/deploy.yml +0 -0
  17. {pyplumio-0.5.41 → pyplumio-0.5.42}/.github/workflows/documentation.yml +0 -0
  18. {pyplumio-0.5.41 → pyplumio-0.5.42}/.gitignore +0 -0
  19. {pyplumio-0.5.41 → pyplumio-0.5.42}/.pre-commit-config.yaml +0 -0
  20. {pyplumio-0.5.41 → pyplumio-0.5.42}/.vscode/settings.json +0 -0
  21. {pyplumio-0.5.41 → pyplumio-0.5.42}/LICENSE +0 -0
  22. {pyplumio-0.5.41 → pyplumio-0.5.42}/MANIFEST.in +0 -0
  23. {pyplumio-0.5.41 → pyplumio-0.5.42}/PyPlumIO.egg-info/SOURCES.txt +0 -0
  24. {pyplumio-0.5.41 → pyplumio-0.5.42}/PyPlumIO.egg-info/dependency_links.txt +0 -0
  25. {pyplumio-0.5.41 → pyplumio-0.5.42}/PyPlumIO.egg-info/requires.txt +0 -0
  26. {pyplumio-0.5.41 → pyplumio-0.5.42}/PyPlumIO.egg-info/top_level.txt +0 -0
  27. {pyplumio-0.5.41 → pyplumio-0.5.42}/README.md +0 -0
  28. {pyplumio-0.5.41 → pyplumio-0.5.42}/docs/Makefile +0 -0
  29. {pyplumio-0.5.41 → pyplumio-0.5.42}/docs/make.bat +0 -0
  30. {pyplumio-0.5.41 → pyplumio-0.5.42}/docs/source/callbacks.rst +0 -0
  31. {pyplumio-0.5.41 → pyplumio-0.5.42}/docs/source/conf.py +0 -0
  32. {pyplumio-0.5.41 → pyplumio-0.5.42}/docs/source/connecting.rst +0 -0
  33. {pyplumio-0.5.41 → pyplumio-0.5.42}/docs/source/frames.rst +0 -0
  34. {pyplumio-0.5.41 → pyplumio-0.5.42}/docs/source/index.rst +0 -0
  35. {pyplumio-0.5.41 → pyplumio-0.5.42}/docs/source/mixers_thermostats.rst +0 -0
  36. {pyplumio-0.5.41 → pyplumio-0.5.42}/docs/source/protocol.rst +0 -0
  37. {pyplumio-0.5.41 → pyplumio-0.5.42}/docs/source/reading.rst +0 -0
  38. {pyplumio-0.5.41 → pyplumio-0.5.42}/docs/source/schedules.rst +0 -0
  39. {pyplumio-0.5.41 → pyplumio-0.5.42}/docs/source/writing.rst +0 -0
  40. {pyplumio-0.5.41 → pyplumio-0.5.42}/images/ecomax.png +0 -0
  41. {pyplumio-0.5.41 → pyplumio-0.5.42}/images/rs485.png +0 -0
  42. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/__init__.py +0 -0
  43. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/__main__.py +0 -0
  44. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/connection.py +0 -0
  45. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/const.py +0 -0
  46. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/devices/__init__.py +0 -0
  47. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/devices/ecomax.py +0 -0
  48. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/devices/ecoster.py +0 -0
  49. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/devices/mixer.py +0 -0
  50. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/devices/thermostat.py +0 -0
  51. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/exceptions.py +0 -0
  52. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/filters.py +0 -0
  53. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/frames/__init__.py +0 -0
  54. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/frames/messages.py +0 -0
  55. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/frames/requests.py +0 -0
  56. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/frames/responses.py +0 -0
  57. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/helpers/__init__.py +0 -0
  58. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/helpers/data_types.py +0 -0
  59. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/helpers/event_manager.py +0 -0
  60. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/helpers/factory.py +0 -0
  61. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/helpers/schedule.py +0 -0
  62. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/helpers/task_manager.py +0 -0
  63. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/helpers/timeout.py +0 -0
  64. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/helpers/uid.py +0 -0
  65. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/protocol.py +0 -0
  66. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/py.typed +0 -0
  67. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/stream.py +0 -0
  68. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/__init__.py +0 -0
  69. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/alerts.py +0 -0
  70. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/boiler_load.py +0 -0
  71. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/boiler_power.py +0 -0
  72. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/fan_power.py +0 -0
  73. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/frame_versions.py +0 -0
  74. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/fuel_consumption.py +0 -0
  75. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/fuel_level.py +0 -0
  76. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/lambda_sensor.py +0 -0
  77. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/mixer_sensors.py +0 -0
  78. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/modules.py +0 -0
  79. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/network_info.py +0 -0
  80. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/output_flags.py +0 -0
  81. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/outputs.py +0 -0
  82. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/pending_alerts.py +0 -0
  83. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/product_info.py +0 -0
  84. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/program_version.py +0 -0
  85. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/regulator_data.py +0 -0
  86. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/regulator_data_schema.py +0 -0
  87. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/schedules.py +0 -0
  88. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/statuses.py +0 -0
  89. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/temperatures.py +0 -0
  90. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/structures/thermostat_sensors.py +0 -0
  91. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyplumio/utils.py +0 -0
  92. {pyplumio-0.5.41 → pyplumio-0.5.42}/pyproject.toml +0 -0
  93. {pyplumio-0.5.41 → pyplumio-0.5.42}/requirements.txt +0 -0
  94. {pyplumio-0.5.41 → pyplumio-0.5.42}/requirements_docs.txt +0 -0
  95. {pyplumio-0.5.41 → pyplumio-0.5.42}/requirements_test.txt +0 -0
  96. {pyplumio-0.5.41 → pyplumio-0.5.42}/setup.cfg +0 -0
  97. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/__init__.py +0 -0
  98. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/conftest.py +0 -0
  99. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/frames/test_init.py +0 -0
  100. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/frames/test_messages.py +0 -0
  101. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/frames/test_requests.py +0 -0
  102. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/frames/test_responses.py +0 -0
  103. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/helpers/__init__.py +0 -0
  104. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/helpers/test_data_types.py +0 -0
  105. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/helpers/test_event_manager.py +0 -0
  106. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/helpers/test_factory.py +0 -0
  107. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/helpers/test_schedule.py +0 -0
  108. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/helpers/test_task_manager.py +0 -0
  109. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/helpers/test_timeout.py +0 -0
  110. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/helpers/test_uid.py +0 -0
  111. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/ruff.toml +0 -0
  112. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/test_connection.py +0 -0
  113. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/test_devices.py +0 -0
  114. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/test_filters.py +0 -0
  115. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/test_init.py +0 -0
  116. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/test_main.py +0 -0
  117. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/test_protocol.py +0 -0
  118. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/test_stream.py +0 -0
  119. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/test_utils.py +0 -0
  120. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/messages/regulator_data.json +0 -0
  121. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/messages/sensor_data.json +0 -0
  122. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/requests/alerts.json +0 -0
  123. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/requests/ecomax_control.json +0 -0
  124. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/requests/ecomax_parameters.json +0 -0
  125. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/requests/mixer_parameters.json +0 -0
  126. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/requests/set_ecomax_parameter.json +0 -0
  127. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/requests/set_mixer_parameter.json +0 -0
  128. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/requests/set_schedule.json +0 -0
  129. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/requests/set_thermostat_parameter.json +0 -0
  130. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/requests/thermostat_parameters.json +0 -0
  131. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/responses/alerts.json +0 -0
  132. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/responses/device_available.json +0 -0
  133. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/responses/ecomax_parameters.json +0 -0
  134. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/responses/mixer_parameters.json +0 -0
  135. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/responses/password.json +0 -0
  136. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/responses/program_version.json +0 -0
  137. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/responses/regulator_data_schema.json +0 -0
  138. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/responses/schedules.json +0 -0
  139. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/responses/thermostat_parameters.json +0 -0
  140. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/responses/uid.json +0 -0
  141. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/unknown/unknown_ecomax_parameter.json +0 -0
  142. {pyplumio-0.5.41 → pyplumio-0.5.42}/tests/testdata/unknown/unknown_mixer_parameter.json +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyPlumIO
3
- Version: 0.5.41
3
+ Version: 0.5.42
4
4
  Summary: PyPlumIO is a native ecoNET library for Plum ecoMAX controllers.
5
5
  Author-email: Denis Paavilainen <denpa@denpa.pro>
6
6
  License: MIT License
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyPlumIO
3
- Version: 0.5.41
3
+ Version: 0.5.42
4
4
  Summary: PyPlumIO is a native ecoNET library for Plum ecoMAX controllers.
5
5
  Author-email: Denis Paavilainen <denpa@denpa.pro>
6
6
  License: MIT License
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.5.41'
21
- __version_tuple__ = version_tuple = (0, 5, 41)
20
+ __version__ = version = '0.5.42'
21
+ __version_tuple__ = version_tuple = (0, 5, 42)
@@ -13,6 +13,7 @@ from typing_extensions import TypeAlias
13
13
 
14
14
  from pyplumio.const import BYTE_UNDEFINED, STATE_OFF, STATE_ON, State, UnitOfMeasurement
15
15
  from pyplumio.frames import Request
16
+ from pyplumio.utils import is_divisible
16
17
 
17
18
  if TYPE_CHECKING:
18
19
  from pyplumio.devices import Device
@@ -286,6 +287,8 @@ class Parameter(ABC):
286
287
  class NumberDescription(ParameterDescription):
287
288
  """Represents a parameter description."""
288
289
 
290
+ step: float = 1.0
291
+ precision: int = 6
289
292
  unit_of_measurement: UnitOfMeasurement | Literal["%"] | None = None
290
293
 
291
294
 
@@ -298,18 +301,24 @@ class Number(Parameter):
298
301
 
299
302
  def _pack_value(self, value: NumericType) -> int:
300
303
  """Pack the parameter value."""
301
- return int(value)
304
+ return int(round(value / self.description.step))
302
305
 
303
306
  def _unpack_value(self, value: int) -> NumericType:
304
307
  """Unpack the parameter value."""
305
- return value
308
+ return round(value * self.description.step, self.description.precision)
306
309
 
307
310
  def validate(self, value: Any) -> bool:
308
311
  """Validate a parameter value."""
309
312
  if value < self.min_value or value > self.max_value:
310
313
  raise ValueError(
311
- f"Invalid number value: {value}. Must be between "
312
- f"{self.min_value} and {self.max_value}."
314
+ f"Invalid value: {value}. The value must be between {self.min_value} "
315
+ f"and {self.max_value}."
316
+ )
317
+
318
+ if not is_divisible(value, self.description.step, self.description.precision):
319
+ raise ValueError(
320
+ f"Invalid value: {value}. The value must be adjusted in increments of "
321
+ f"{self.description.step}."
313
322
  )
314
323
 
315
324
  return True
@@ -33,7 +33,7 @@ from pyplumio.helpers.parameter import (
33
33
  )
34
34
  from pyplumio.structures import StructureDecoder
35
35
  from pyplumio.structures.thermostat_parameters import ATTR_THERMOSTAT_PROFILE
36
- from pyplumio.utils import ensure_dict, is_divisible
36
+ from pyplumio.utils import ensure_dict
37
37
 
38
38
  if TYPE_CHECKING:
39
39
  from pyplumio.devices.ecomax import EcoMAX
@@ -90,9 +90,7 @@ class EcomaxParameter(Parameter):
90
90
  class EcomaxNumberDescription(EcomaxParameterDescription, NumberDescription):
91
91
  """Represents an ecoMAX number description."""
92
92
 
93
- step: float = 1.0
94
93
  offset: int = 0
95
- precision: int = 6
96
94
 
97
95
 
98
96
  class EcomaxNumber(EcomaxParameter, Number):
@@ -102,25 +100,13 @@ class EcomaxNumber(EcomaxParameter, Number):
102
100
 
103
101
  description: EcomaxNumberDescription
104
102
 
105
- def validate(self, value: NumericType) -> bool:
106
- """Validate the parameter value."""
107
- if not is_divisible(value, self.description.step, self.description.precision):
108
- raise ValueError(
109
- f"Invalid value: {value}. The value must be adjusted in increments of "
110
- f"{self.description.step}."
111
- )
112
-
113
- return super().validate(value)
114
-
115
103
  def _pack_value(self, value: NumericType) -> int:
116
104
  """Pack the parameter value."""
117
- value += self.description.offset
118
- return round(value / self.description.step)
105
+ return super()._pack_value(value + self.description.offset)
119
106
 
120
107
  def _unpack_value(self, value: int) -> NumericType:
121
108
  """Unpack the parameter value."""
122
- value -= self.description.offset
123
- return round(value * self.description.step, self.description.precision)
109
+ return super()._unpack_value(value - self.description.offset)
124
110
 
125
111
 
126
112
  @dataslots
@@ -29,7 +29,7 @@ from pyplumio.helpers.parameter import (
29
29
  unpack_parameter,
30
30
  )
31
31
  from pyplumio.structures import StructureDecoder
32
- from pyplumio.utils import ensure_dict, is_divisible
32
+ from pyplumio.utils import ensure_dict
33
33
 
34
34
  if TYPE_CHECKING:
35
35
  from pyplumio.devices.mixer import Mixer
@@ -72,9 +72,7 @@ class MixerParameter(Parameter):
72
72
  class MixerNumberDescription(MixerParameterDescription, NumberDescription):
73
73
  """Represent a mixer number description."""
74
74
 
75
- step: float = 1.0
76
75
  offset: int = 0
77
- precision: int = 6
78
76
 
79
77
 
80
78
  class MixerNumber(MixerParameter, Number):
@@ -84,25 +82,13 @@ class MixerNumber(MixerParameter, Number):
84
82
 
85
83
  description: MixerNumberDescription
86
84
 
87
- def validate(self, value: NumericType) -> bool:
88
- """Validate the parameter value."""
89
- if not is_divisible(value, self.description.step, self.description.precision):
90
- raise ValueError(
91
- f"Invalid value: {value}. The value must be adjusted in increments of "
92
- f"{self.description.step}."
93
- )
94
-
95
- return super().validate(value)
96
-
97
85
  def _pack_value(self, value: NumericType) -> int:
98
86
  """Pack the parameter value."""
99
- value += self.description.offset
100
- return round(value / self.description.step)
87
+ return super()._pack_value(value + self.description.offset)
101
88
 
102
89
  def _unpack_value(self, value: int) -> NumericType:
103
90
  """Unpack the parameter value."""
104
- value -= self.description.offset
105
- return round(value * self.description.step, self.description.precision)
91
+ return super()._unpack_value(value - self.description.offset)
106
92
 
107
93
 
108
94
  @dataslots
@@ -20,7 +20,6 @@ from pyplumio.frames import Request
20
20
  from pyplumio.helpers.parameter import (
21
21
  Number,
22
22
  NumberDescription,
23
- NumericType,
24
23
  Parameter,
25
24
  ParameterDescription,
26
25
  ParameterValues,
@@ -30,7 +29,7 @@ from pyplumio.helpers.parameter import (
30
29
  )
31
30
  from pyplumio.structures import StructureDecoder
32
31
  from pyplumio.structures.thermostat_sensors import ATTR_THERMOSTATS_AVAILABLE
33
- from pyplumio.utils import ensure_dict, is_divisible
32
+ from pyplumio.utils import ensure_dict
34
33
 
35
34
  if TYPE_CHECKING:
36
35
  from pyplumio.devices.thermostat import Thermostat
@@ -93,9 +92,6 @@ class ThermostatParameter(Parameter):
93
92
  class ThermostatNumberDescription(ThermostatParameterDescription, NumberDescription):
94
93
  """Represent a thermostat number description."""
95
94
 
96
- step: float = 1.0
97
- precision: int = 6
98
-
99
95
 
100
96
  class ThermostatNumber(ThermostatParameter, Number):
101
97
  """Represents a thermostat number."""
@@ -104,24 +100,6 @@ class ThermostatNumber(ThermostatParameter, Number):
104
100
 
105
101
  description: ThermostatNumberDescription
106
102
 
107
- def validate(self, value: NumericType) -> bool:
108
- """Validate the parameter value."""
109
- if not is_divisible(value, self.description.step, self.description.precision):
110
- raise ValueError(
111
- f"Invalid value: {value}. The value must be adjusted in increments of "
112
- f"{self.description.step}."
113
- )
114
-
115
- return super().validate(value)
116
-
117
- def _pack_value(self, value: NumericType) -> int:
118
- """Pack the parameter value."""
119
- return round(value / self.description.step)
120
-
121
- def _unpack_value(self, value: int) -> NumericType:
122
- """Unpack the parameter value."""
123
- return round(value * self.description.step, self.description.precision)
124
-
125
103
 
126
104
  @dataslots
127
105
  @dataclass
@@ -285,7 +285,8 @@ def test_number_repr(number: Number) -> None:
285
285
  """Test a number representation."""
286
286
  assert repr(number) == (
287
287
  f"Number(device={number.device}, "
288
- "description=NumberDescription(name='test_number', optimistic=False, "
288
+ "description=NumberDescription("
289
+ "name='test_number', optimistic=False, step=1.0, precision=6, "
289
290
  "unit_of_measurement=<UnitOfMeasurement.CELSIUS: '°C'>), "
290
291
  "values=ParameterValues(value=1, min_value=0, max_value=5), "
291
292
  "index=0)"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes