PyPlumIO 0.5.23__tar.gz → 0.5.24__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.
- {pyplumio-0.5.23 → pyplumio-0.5.24}/PKG-INFO +1 -1
- {pyplumio-0.5.23 → pyplumio-0.5.24}/PyPlumIO.egg-info/PKG-INFO +1 -1
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/_version.py +2 -2
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/helpers/parameter.py +12 -3
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/helpers/test_parameter.py +13 -1
- {pyplumio-0.5.23 → pyplumio-0.5.24}/.gitattributes +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/.github/CODE_OF_CONDUCT.md +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/.github/dependabot.yml +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/.github/workflows/ci.yml +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/.github/workflows/codeql-analysis.yml +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/.github/workflows/deploy.yml +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/.github/workflows/documentation.yml +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/.gitignore +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/.pre-commit-config.yaml +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/.vscode/settings.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/LICENSE +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/MANIFEST.in +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/PyPlumIO.egg-info/SOURCES.txt +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/PyPlumIO.egg-info/dependency_links.txt +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/PyPlumIO.egg-info/requires.txt +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/PyPlumIO.egg-info/top_level.txt +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/README.md +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/docs/Makefile +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/docs/make.bat +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/docs/source/callbacks.rst +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/docs/source/conf.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/docs/source/connecting.rst +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/docs/source/frames.rst +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/docs/source/index.rst +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/docs/source/mixers_thermostats.rst +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/docs/source/protocol.rst +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/docs/source/reading.rst +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/docs/source/schedules.rst +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/docs/source/writing.rst +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/images/ecomax.png +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/images/rs485.png +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/__init__.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/__main__.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/connection.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/const.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/devices/__init__.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/devices/ecomax.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/devices/ecoster.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/devices/mixer.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/devices/thermostat.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/exceptions.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/filters.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/frames/__init__.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/frames/messages.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/frames/requests.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/frames/responses.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/helpers/__init__.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/helpers/data_types.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/helpers/event_manager.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/helpers/factory.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/helpers/schedule.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/helpers/task_manager.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/helpers/timeout.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/helpers/uid.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/protocol.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/py.typed +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/stream.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/__init__.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/alerts.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/boiler_load.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/boiler_power.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/ecomax_parameters.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/fan_power.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/frame_versions.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/fuel_consumption.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/fuel_level.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/lambda_sensor.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/mixer_parameters.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/mixer_sensors.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/modules.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/network_info.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/output_flags.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/outputs.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/pending_alerts.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/product_info.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/program_version.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/regulator_data.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/regulator_data_schema.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/schedules.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/statuses.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/temperatures.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/thermostat_parameters.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/structures/thermostat_sensors.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyplumio/utils.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/pyproject.toml +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/requirements.txt +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/requirements_docs.txt +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/requirements_test.txt +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/setup.cfg +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/__init__.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/conftest.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/frames/test_init.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/frames/test_messages.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/frames/test_requests.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/frames/test_responses.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/helpers/__init__.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/helpers/test_data_types.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/helpers/test_event_manager.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/helpers/test_factory.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/helpers/test_schedule.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/helpers/test_task_manager.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/helpers/test_timeout.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/helpers/test_uid.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/ruff.toml +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/test_connection.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/test_devices.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/test_filters.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/test_init.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/test_main.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/test_protocol.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/test_stream.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/test_utils.py +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/messages/regulator_data.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/messages/sensor_data.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/requests/alerts.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/requests/ecomax_control.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/requests/ecomax_parameters.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/requests/mixer_parameters.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/requests/set_ecomax_parameter.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/requests/set_mixer_parameter.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/requests/set_schedule.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/requests/set_thermostat_parameter.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/requests/thermostat_parameters.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/responses/alerts.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/responses/device_available.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/responses/ecomax_parameters.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/responses/mixer_parameters.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/responses/password.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/responses/program_version.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/responses/regulator_data_schema.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/responses/schedules.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/responses/thermostat_parameters.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/responses/uid.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/unknown/unknown_ecomax_parameter.json +0 -0
- {pyplumio-0.5.23 → pyplumio-0.5.24}/tests/testdata/unknown/unknown_mixer_parameter.json +0 -0
@@ -113,9 +113,18 @@ class Parameter(ABC):
|
|
113
113
|
|
114
114
|
def _call_relational_method(self, method_to_call: str, other: Any) -> Any:
|
115
115
|
"""Call a specified relational method."""
|
116
|
-
|
117
|
-
|
118
|
-
|
116
|
+
if isinstance(other, Parameter):
|
117
|
+
other = other.values
|
118
|
+
|
119
|
+
if isinstance(other, ParameterValues):
|
120
|
+
handler = getattr(self.values, method_to_call)
|
121
|
+
return handler(other)
|
122
|
+
|
123
|
+
if isinstance(other, (int, float, bool)) or other in (STATE_OFF, STATE_ON):
|
124
|
+
handler = getattr(self.values.value, method_to_call)
|
125
|
+
return handler(_normalize_parameter_value(other))
|
126
|
+
else:
|
127
|
+
return NotImplemented
|
119
128
|
|
120
129
|
def __int__(self) -> int:
|
121
130
|
"""Return an integer representation of parameter's value."""
|
@@ -1,5 +1,6 @@
|
|
1
1
|
"""Contains tests for the parameter helper class."""
|
2
2
|
|
3
|
+
from copy import copy
|
3
4
|
from unittest.mock import Mock, patch
|
4
5
|
|
5
6
|
import pytest
|
@@ -171,21 +172,32 @@ def test_switch_update(switch: Switch) -> None:
|
|
171
172
|
|
172
173
|
def test_number_relational(number: Number):
|
173
174
|
"""Test number relational methods."""
|
175
|
+
new_number = copy(number)
|
176
|
+
assert number == new_number
|
174
177
|
assert (number - 1) == 0
|
178
|
+
new_values = ParameterValues(value=1, min_value=0, max_value=5)
|
179
|
+
number.update(new_values)
|
180
|
+
assert number == new_values
|
175
181
|
assert (number + 1) == 2
|
176
182
|
assert (number * 5) == 5
|
177
183
|
assert (number / 1) == 1
|
178
184
|
assert (number // 1) == 1
|
185
|
+
assert number.__eq__("cola") is NotImplemented
|
179
186
|
|
180
187
|
|
181
188
|
def test_switch_relational(switch: Switch):
|
182
189
|
"""Test switch relational methods."""
|
190
|
+
new_switch = copy(switch)
|
191
|
+
assert switch == new_switch
|
192
|
+
new_values = ParameterValues(value=1, min_value=0, max_value=1)
|
183
193
|
assert (switch + 1) == 1
|
184
|
-
switch.update(
|
194
|
+
switch.update(new_values)
|
195
|
+
assert switch == new_values
|
185
196
|
assert (switch - 1) == 0
|
186
197
|
assert (switch * 0) == 0
|
187
198
|
assert (switch / 1) == 1
|
188
199
|
assert (switch // 1) == 1
|
200
|
+
assert switch.__eq__("cola") is NotImplemented
|
189
201
|
|
190
202
|
|
191
203
|
def test_number_compare(number: Number) -> None:
|
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
|
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
|
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
|
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
|
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
|
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
|