PyPlumIO 0.6.0__py3-none-any.whl → 0.6.2__py3-none-any.whl

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 (49) hide show
  1. pyplumio/__init__.py +3 -1
  2. pyplumio/_version.py +2 -2
  3. pyplumio/connection.py +0 -36
  4. pyplumio/const.py +0 -5
  5. pyplumio/data_types.py +2 -2
  6. pyplumio/devices/__init__.py +23 -5
  7. pyplumio/devices/ecomax.py +30 -53
  8. pyplumio/devices/ecoster.py +2 -3
  9. pyplumio/filters.py +199 -136
  10. pyplumio/frames/__init__.py +101 -15
  11. pyplumio/frames/messages.py +8 -65
  12. pyplumio/frames/requests.py +38 -38
  13. pyplumio/frames/responses.py +30 -86
  14. pyplumio/helpers/async_cache.py +13 -8
  15. pyplumio/helpers/event_manager.py +24 -18
  16. pyplumio/helpers/factory.py +0 -3
  17. pyplumio/parameters/__init__.py +38 -35
  18. pyplumio/protocol.py +63 -47
  19. pyplumio/structures/alerts.py +2 -2
  20. pyplumio/structures/ecomax_parameters.py +1 -1
  21. pyplumio/structures/frame_versions.py +3 -2
  22. pyplumio/structures/mixer_parameters.py +5 -3
  23. pyplumio/structures/network_info.py +1 -0
  24. pyplumio/structures/product_info.py +1 -1
  25. pyplumio/structures/program_version.py +2 -2
  26. pyplumio/structures/schedules.py +8 -40
  27. pyplumio/structures/sensor_data.py +498 -0
  28. pyplumio/structures/thermostat_parameters.py +7 -4
  29. pyplumio/utils.py +41 -4
  30. {pyplumio-0.6.0.dist-info → pyplumio-0.6.2.dist-info}/METADATA +7 -8
  31. pyplumio-0.6.2.dist-info/RECORD +50 -0
  32. pyplumio/structures/boiler_load.py +0 -32
  33. pyplumio/structures/boiler_power.py +0 -33
  34. pyplumio/structures/fan_power.py +0 -33
  35. pyplumio/structures/fuel_consumption.py +0 -36
  36. pyplumio/structures/fuel_level.py +0 -39
  37. pyplumio/structures/lambda_sensor.py +0 -57
  38. pyplumio/structures/mixer_sensors.py +0 -80
  39. pyplumio/structures/modules.py +0 -102
  40. pyplumio/structures/output_flags.py +0 -47
  41. pyplumio/structures/outputs.py +0 -88
  42. pyplumio/structures/pending_alerts.py +0 -28
  43. pyplumio/structures/statuses.py +0 -52
  44. pyplumio/structures/temperatures.py +0 -94
  45. pyplumio/structures/thermostat_sensors.py +0 -106
  46. pyplumio-0.6.0.dist-info/RECORD +0 -63
  47. {pyplumio-0.6.0.dist-info → pyplumio-0.6.2.dist-info}/WHEEL +0 -0
  48. {pyplumio-0.6.0.dist-info → pyplumio-0.6.2.dist-info}/licenses/LICENSE +0 -0
  49. {pyplumio-0.6.0.dist-info → pyplumio-0.6.2.dist-info}/top_level.txt +0 -0
@@ -1,94 +0,0 @@
1
- """Contains a temperatures structure decoder."""
2
-
3
- from __future__ import annotations
4
-
5
- import math
6
- from typing import Any, Final
7
-
8
- from pyplumio.data_types import Float
9
- from pyplumio.structures import StructureDecoder
10
- from pyplumio.utils import ensure_dict
11
-
12
- ATTR_HEATING_TEMP: Final = "heating_temp"
13
- ATTR_FEEDER_TEMP: Final = "feeder_temp"
14
- ATTR_WATER_HEATER_TEMP: Final = "water_heater_temp"
15
- ATTR_OUTSIDE_TEMP: Final = "outside_temp"
16
- ATTR_RETURN_TEMP: Final = "return_temp"
17
- ATTR_EXHAUST_TEMP: Final = "exhaust_temp"
18
- ATTR_OPTICAL_TEMP: Final = "optical_temp"
19
- ATTR_UPPER_BUFFER_TEMP: Final = "upper_buffer_temp"
20
- ATTR_LOWER_BUFFER_TEMP: Final = "lower_buffer_temp"
21
- ATTR_UPPER_SOLAR_TEMP: Final = "upper_solar_temp"
22
- ATTR_LOWER_SOLAR_TEMP: Final = "lower_solar_temp"
23
- ATTR_FIREPLACE_TEMP: Final = "fireplace_temp"
24
- ATTR_TOTAL_GAIN: Final = "total_gain"
25
- ATTR_HYDRAULIC_COUPLER_TEMP: Final = "hydraulic_coupler_temp"
26
- ATTR_EXCHANGER_TEMP: Final = "exchanger_temp"
27
- ATTR_AIR_IN_TEMP: Final = "air_in_temp"
28
- ATTR_AIR_OUT_TEMP: Final = "air_out_temp"
29
-
30
- TEMPERATURES: tuple[str, ...] = (
31
- ATTR_HEATING_TEMP,
32
- ATTR_FEEDER_TEMP,
33
- ATTR_WATER_HEATER_TEMP,
34
- ATTR_OUTSIDE_TEMP,
35
- ATTR_RETURN_TEMP,
36
- ATTR_EXHAUST_TEMP,
37
- ATTR_OPTICAL_TEMP,
38
- ATTR_UPPER_BUFFER_TEMP,
39
- ATTR_LOWER_BUFFER_TEMP,
40
- ATTR_UPPER_SOLAR_TEMP,
41
- ATTR_LOWER_SOLAR_TEMP,
42
- ATTR_FIREPLACE_TEMP,
43
- ATTR_TOTAL_GAIN,
44
- ATTR_HYDRAULIC_COUPLER_TEMP,
45
- ATTR_EXCHANGER_TEMP,
46
- ATTR_AIR_IN_TEMP,
47
- ATTR_AIR_OUT_TEMP,
48
- )
49
-
50
-
51
- class TemperaturesStructure(StructureDecoder):
52
- """Represents a temperatures data structure."""
53
-
54
- __slots__ = ()
55
-
56
- def decode(
57
- self, message: bytearray, offset: int = 0, data: dict[str, Any] | None = None
58
- ) -> tuple[dict[str, Any], int]:
59
- """Decode bytes and return message data and offset."""
60
- data = ensure_dict(data)
61
- temperatures = message[offset]
62
- offset += 1
63
- for _ in range(temperatures):
64
- index = message[offset]
65
- offset += 1
66
- temp = Float.from_bytes(message, offset)
67
- offset += temp.size
68
- if (not math.isnan(temp.value)) and 0 <= index < len(TEMPERATURES):
69
- # Temperature exists and index is in the correct range.
70
- data[TEMPERATURES[index]] = temp.value
71
-
72
- return data, offset
73
-
74
-
75
- __all__ = [
76
- "ATTR_HEATING_TEMP",
77
- "ATTR_FEEDER_TEMP",
78
- "ATTR_WATER_HEATER_TEMP",
79
- "ATTR_OUTSIDE_TEMP",
80
- "ATTR_RETURN_TEMP",
81
- "ATTR_EXHAUST_TEMP",
82
- "ATTR_OPTICAL_TEMP",
83
- "ATTR_UPPER_BUFFER_TEMP",
84
- "ATTR_LOWER_BUFFER_TEMP",
85
- "ATTR_UPPER_SOLAR_TEMP",
86
- "ATTR_LOWER_SOLAR_TEMP",
87
- "ATTR_FIREPLACE_TEMP",
88
- "ATTR_TOTAL_GAIN",
89
- "ATTR_HYDRAULIC_COUPLER_TEMP",
90
- "ATTR_EXCHANGER_TEMP",
91
- "ATTR_AIR_IN_TEMP",
92
- "ATTR_AIR_OUT_TEMP",
93
- "TemperaturesStructure",
94
- ]
@@ -1,106 +0,0 @@
1
- """Contains a thermostat sensors structure decoder."""
2
-
3
- from __future__ import annotations
4
-
5
- from collections.abc import Generator
6
- import math
7
- from typing import Any, Final
8
-
9
- from pyplumio.const import (
10
- ATTR_CURRENT_TEMP,
11
- ATTR_SCHEDULE,
12
- ATTR_STATE,
13
- ATTR_TARGET_TEMP,
14
- BYTE_UNDEFINED,
15
- )
16
- from pyplumio.data_types import Float
17
- from pyplumio.structures import StructureDecoder
18
- from pyplumio.utils import ensure_dict
19
-
20
- ATTR_THERMOSTAT_SENSORS: Final = "thermostat_sensors"
21
- ATTR_THERMOSTATS_AVAILABLE: Final = "thermostats_available"
22
- ATTR_THERMOSTATS_CONNECTED: Final = "thermostats_connected"
23
- ATTR_CONTACTS: Final = "contacts"
24
-
25
-
26
- class ThermostatSensorsStructure(StructureDecoder):
27
- """Represents a thermostats sensors data structure."""
28
-
29
- __slots__ = ("_offset", "_contact_mask", "_schedule_mask")
30
-
31
- _offset: int
32
- _contact_mask: int
33
- _schedule_mask: int
34
-
35
- def _unpack_thermostat_sensors(
36
- self, message: bytearray, contacts: int
37
- ) -> dict[str, Any] | None:
38
- """Unpack sensors for a thermostat."""
39
- offset = self._offset
40
- state = message[offset]
41
- offset += 1
42
- current_temp = Float.from_bytes(message, offset)
43
- offset += current_temp.size
44
- target_temp = Float.from_bytes(message, offset)
45
- offset += target_temp.size
46
-
47
- try:
48
- return (
49
- {
50
- ATTR_STATE: state,
51
- ATTR_CURRENT_TEMP: current_temp.value,
52
- ATTR_TARGET_TEMP: target_temp.value,
53
- ATTR_CONTACTS: bool(contacts & self._contact_mask),
54
- ATTR_SCHEDULE: bool(contacts & self._schedule_mask),
55
- }
56
- if not math.isnan(current_temp.value) and target_temp.value > 0
57
- else None
58
- )
59
- finally:
60
- self._offset = offset
61
- self._contact_mask <<= 1
62
- self._schedule_mask <<= 1
63
-
64
- def _thermostat_sensors(
65
- self, message: bytearray, thermostats: int, contacts: int
66
- ) -> Generator[tuple[int, dict[str, Any]], None, None]:
67
- """Get sensors for a thermostat."""
68
- for index in range(thermostats):
69
- if sensors := self._unpack_thermostat_sensors(message, contacts):
70
- yield (index, sensors)
71
-
72
- def decode(
73
- self, message: bytearray, offset: int = 0, data: dict[str, Any] | None = None
74
- ) -> tuple[dict[str, Any], int]:
75
- """Decode bytes and return message data and offset."""
76
- if message[offset] == BYTE_UNDEFINED:
77
- return ensure_dict(data), offset + 1
78
-
79
- contacts = message[offset]
80
- thermostats = message[offset + 1]
81
- self._offset = offset + 2
82
- self._contact_mask = 1
83
- self._schedule_mask = 1 << 3
84
- thermostat_sensors = dict(
85
- self._thermostat_sensors(message, thermostats, contacts)
86
- )
87
- return (
88
- ensure_dict(
89
- data,
90
- {
91
- ATTR_THERMOSTAT_SENSORS: thermostat_sensors,
92
- ATTR_THERMOSTATS_AVAILABLE: thermostats,
93
- ATTR_THERMOSTATS_CONNECTED: len(thermostat_sensors),
94
- },
95
- ),
96
- self._offset,
97
- )
98
-
99
-
100
- __all__ = [
101
- "ATTR_THERMOSTAT_SENSORS",
102
- "ATTR_THERMOSTATS_AVAILABLE",
103
- "ATTR_THERMOSTATS_CONNECTED",
104
- "ATTR_CONTACTS",
105
- "ThermostatSensorsStructure",
106
- ]
@@ -1,63 +0,0 @@
1
- pyplumio/__init__.py,sha256=DQg-ZTAxLYuNKyqsGrcO0QrVAMw9aPA69Bv2mZ7ubXQ,3314
2
- pyplumio/__main__.py,sha256=3IwHHSq-iay5FaeMc95klobe-xv82yydSKcBE7BFZ6M,500
3
- pyplumio/_version.py,sha256=MAYWefOLb6kbIRub18WSzK6ggSjz1LNLy9aDRlX9Ea4,704
4
- pyplumio/connection.py,sha256=9Gzg6FXMU-HjspsDnm9XH8ZPBO29AZ6dKS2-eg8P8Z0,7686
5
- pyplumio/const.py,sha256=oYwXB3N6bvFLc6411icbABbBkSoQcj5BGuyD-NaKYp8,5629
6
- pyplumio/data_types.py,sha256=BTDxwErRo_odvFT5DNfIniNh8ZfyjRKEDaJmoEJqdEg,9426
7
- pyplumio/exceptions.py,sha256=_B_0EgxDxd2XyYv3WpZM733q0cML5m6J-f55QOvYRpI,996
8
- pyplumio/filters.py,sha256=sBEnr0i_1XMbIwIEA24npbpe5yevSRneynlsqJMyfko,15642
9
- pyplumio/protocol.py,sha256=jGx5b8y_1jbdFbjL_ZbUjpDvgBYhn5JUBsVsf_De6Ls,11614
10
- pyplumio/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- pyplumio/stream.py,sha256=zFMKZ_GxsSGcaBTJigVM1CK3uGjlEJXgcvKqus8MDzk,7740
12
- pyplumio/utils.py,sha256=SV47Y6QC_KL-gPmk6KQgx7ArExzNHGKuaddGAHjT9rs,1839
13
- pyplumio/devices/__init__.py,sha256=d0E5hTV7UPa8flq8TNlKf_jt4cOSbRigSE9jjDHrmDI,8302
14
- pyplumio/devices/ecomax.py,sha256=1QasnLFgNCplSoDXXe5wUr8JQjr6ChSEGijamXtJZVM,16356
15
- pyplumio/devices/ecoster.py,sha256=X46ky5XT8jHMFq9sBW0ve8ZI_tjItQDMt4moXsW-ogY,307
16
- pyplumio/devices/mixer.py,sha256=7WdUVgwO4VXmaPNzh3ZWpKr2ooRXWemz2KFHAw35_Rk,2731
17
- pyplumio/devices/thermostat.py,sha256=MHMKe45fQ7jKlhBVObJ7McbYQKuF6-LOKSHy-9VNsCU,2253
18
- pyplumio/frames/__init__.py,sha256=jIYP31yP60FVXp8ygOcKkbJCosodiqWCvnrY9FOgH4g,7885
19
- pyplumio/frames/messages.py,sha256=ImQGWFFTa2eaXfytQmFZKC-IxyPRkxD8qp0bEm16-ws,3628
20
- pyplumio/frames/requests.py,sha256=jr-_XSSCCDDTbAmrw95CKyWa5nb7JNeGzZ2jDXIxlAo,7348
21
- pyplumio/frames/responses.py,sha256=M6Ky4gg2AoShmRXX0x6nftajxrvmQLKPVRWbwyhvI0E,6663
22
- pyplumio/helpers/__init__.py,sha256=H2xxdkF-9uADLwEbfBUoxNTdwru3L5Z2cfJjgsuRsn0,31
23
- pyplumio/helpers/async_cache.py,sha256=PUkUTo3lmIhslejg0dGWjbcES09E62d9YYgDcBK_G6Q,1275
24
- pyplumio/helpers/event_manager.py,sha256=cev3_X5a7rBvT4KXIwGpyAnOdWd-3svWDETN3yumkhg,8067
25
- pyplumio/helpers/factory.py,sha256=c3sitnkUjJWz7fPpTE9uRIpa8h46Qim3xsAblMw3eDo,1049
26
- pyplumio/helpers/task_manager.py,sha256=N71F6Ag1HHxdf5zJeCMcEziFdH9lmJKtMPoRGjJ-E40,1209
27
- pyplumio/parameters/__init__.py,sha256=d2gLX-Ve6UxwxLbiTQU6AGNYrC4ywXK1dJ7F92OkfgM,16108
28
- pyplumio/parameters/ecomax.py,sha256=KjHlkVZK2XYEl4HNSdCRLAnv0KEn7gjnEO_CsKFZwIw,26199
29
- pyplumio/parameters/mixer.py,sha256=cjwe6AJdboAIEnCeiYNqIRmOVo3dSQqbMTWgiCSx8J8,6606
30
- pyplumio/parameters/thermostat.py,sha256=sRAndI87jANM8uvdQc1LdkT6_baDxf0AEAFVYRstzNE,5039
31
- pyplumio/parameters/custom/__init__.py,sha256=EeddoseRsh2Gxche3e3woRBgNszraOnLUs9TciK7dCA,3168
32
- pyplumio/parameters/custom/ecomax_860d3_hb.py,sha256=IsNgDXmV90QpBilDV4fGSBtIUEQJJbR9rjnfCr3-pHE,2840
33
- pyplumio/structures/__init__.py,sha256=tb62y-x466WSogdjNpsvqcD3Kiz7xMW604m2-yJH3jc,1329
34
- pyplumio/structures/alerts.py,sha256=9cBzxo1R5erJVeQUdWOmEDG82wXgm7vAU9X6xJjRAjk,3690
35
- pyplumio/structures/boiler_load.py,sha256=e-6itp9L6iJeeOyhSTiOclHLuYmqG7KkcepsHwJSQSI,894
36
- pyplumio/structures/boiler_power.py,sha256=7CdOk-pYLEpy06oRBAeichvq8o-a2RcesB0tzo9ccBs,951
37
- pyplumio/structures/ecomax_parameters.py,sha256=E_s5bO0RqX8p1rM5DtYAsEXcHqS8P6Tg4AGm21cxsnM,1663
38
- pyplumio/structures/fan_power.py,sha256=l9mDB_Ugnn1gKJFh9fppwzoi0i1_3eBvHAD6uPAdiDI,915
39
- pyplumio/structures/frame_versions.py,sha256=n-L93poxY3i_l3oMWg0PzRXGrkY9cgv-Eyuf9XObaR4,1602
40
- pyplumio/structures/fuel_consumption.py,sha256=Cf3Z14gEZnkVEt-OAXNka3-T8fKIMHQaVSeQdQYXnPg,1034
41
- pyplumio/structures/fuel_level.py,sha256=-zUKApVJaZZzc1q52vqO3K2Mya43c6vRgw45d2xgy5Q,1123
42
- pyplumio/structures/lambda_sensor.py,sha256=09nM4Hwn1X275LzFpDihtpzkazwgJXAbx4NFqUkhbNM,1609
43
- pyplumio/structures/mixer_parameters.py,sha256=JMSySqI7TUGKdFtDp1P5DJm5EAbijMSz-orRrAe1KlQ,2041
44
- pyplumio/structures/mixer_sensors.py,sha256=ChgLhC3p4fyoPy1EKe0BQTvXOPZEISbcK2HyamrNaN8,2450
45
- pyplumio/structures/modules.py,sha256=-8krDmCtrLwP3GvVMe3e-dN8Zbe4R0F1cZZuEo6N2zc,2759
46
- pyplumio/structures/network_info.py,sha256=g5SkVS8QhUKa-Pt8rxJ5BAbz09hck6-npZb5a8KjIEg,4405
47
- pyplumio/structures/output_flags.py,sha256=upVIgAH2JNncHFXvjE-t6oTFF-JNwwZbyGjfrcKWtz0,1508
48
- pyplumio/structures/outputs.py,sha256=3NP5lArzQiihRC4QzBuWAHL9hhjvGxNkKmeoYZnDD-0,2291
49
- pyplumio/structures/pending_alerts.py,sha256=b1uMmDHTGv8eE0h1vGBrKsPxlwBmUad7HgChnDDLK_g,801
50
- pyplumio/structures/product_info.py,sha256=QEr2x8GAoXCc1_UzdaVWALRdi2ouMrBtGb684OBNgAQ,3255
51
- pyplumio/structures/program_version.py,sha256=QLe_jFZcUOjWsEXrnXRiueFb4MR0coIGOymTtBiYtyg,2589
52
- pyplumio/structures/regulator_data.py,sha256=SYKI1YPC3mDAth-SpYejttbD0IzBfobjgC-uy_uUKnw,2333
53
- pyplumio/structures/regulator_data_schema.py,sha256=0SapbZCGzqAHmHC7dwhufszJ9FNo_ZO_XMrFGNiUe-w,1547
54
- pyplumio/structures/schedules.py,sha256=IJ7hxGmLxgCtzGrMncXJBRddbc4quf91Wv_R-Y3ZJXA,11820
55
- pyplumio/structures/statuses.py,sha256=1h-EUw1UtuS44E19cNOSavUgZeAxsLgX3iS0eVC8pLI,1325
56
- pyplumio/structures/temperatures.py,sha256=2VD3P_vwp9PEBkOn2-WhifOR8w-UYNq35aAxle0z2Vg,2831
57
- pyplumio/structures/thermostat_parameters.py,sha256=st3x3HkjQm3hqBrn_fpvPDQu8fuc-Sx33ONB19ViQak,3007
58
- pyplumio/structures/thermostat_sensors.py,sha256=rO9jTZWGQpThtJqVdbbv8sYMYHxJi4MfwZQza69L2zw,3399
59
- pyplumio-0.6.0.dist-info/licenses/LICENSE,sha256=m-UuZFjXJ22uPTGm9kSHS8bqjsf5T8k2wL9bJn1Y04o,1088
60
- pyplumio-0.6.0.dist-info/METADATA,sha256=fyZvRedY6toO1OuENZe4ytYtPA0EFJqYb7CJy-Tswlo,5579
61
- pyplumio-0.6.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
62
- pyplumio-0.6.0.dist-info/top_level.txt,sha256=kNBz9UPPkPD9teDn3U_sEy5LjzwLm9KfADCXtBlbw8A,9
63
- pyplumio-0.6.0.dist-info/RECORD,,