weheat 2024.9.10rc2__tar.gz → 2024.9.23__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.

Potentially problematic release.


This version of weheat might be problematic. Click here for more details.

Files changed (42) hide show
  1. {weheat-2024.9.10rc2/weheat.egg-info → weheat-2024.9.23}/PKG-INFO +1 -1
  2. {weheat-2024.9.10rc2 → weheat-2024.9.23}/pyproject.toml +1 -1
  3. {weheat-2024.9.10rc2 → weheat-2024.9.23}/setup.py +1 -1
  4. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/abstractions/discovery.py +13 -3
  5. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/abstractions/heat_pump.py +26 -5
  6. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/models/heat_pump_model.py +4 -1
  7. {weheat-2024.9.10rc2 → weheat-2024.9.23/weheat.egg-info}/PKG-INFO +1 -1
  8. {weheat-2024.9.10rc2 → weheat-2024.9.23}/LICENSE +0 -0
  9. {weheat-2024.9.10rc2 → weheat-2024.9.23}/README.md +0 -0
  10. {weheat-2024.9.10rc2 → weheat-2024.9.23}/setup.cfg +0 -0
  11. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/__init__.py +0 -0
  12. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/abstractions/__init__.py +0 -0
  13. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/abstractions/auth.py +0 -0
  14. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/abstractions/user.py +0 -0
  15. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/api/__init__.py +0 -0
  16. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/api/energy_log_api.py +0 -0
  17. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/api/heat_pump_api.py +0 -0
  18. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/api/heat_pump_log_api.py +0 -0
  19. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/api/user_api.py +0 -0
  20. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/api_client.py +0 -0
  21. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/api_response.py +0 -0
  22. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/configuration.py +0 -0
  23. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/exceptions.py +0 -0
  24. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/models/__init__.py +0 -0
  25. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/models/boiler_type.py +0 -0
  26. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/models/device_state.py +0 -0
  27. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/models/dhw_type.py +0 -0
  28. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/models/energy_view_dto.py +0 -0
  29. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/models/heat_pump_log_view_dto.py +0 -0
  30. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/models/heat_pump_status_enum.py +0 -0
  31. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/models/heat_pump_type.py +0 -0
  32. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/models/raw_heat_pump_log_dto.py +0 -0
  33. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/models/read_all_heat_pump_dto.py +0 -0
  34. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/models/read_heat_pump_dto.py +0 -0
  35. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/models/read_user_dto.py +0 -0
  36. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/models/role.py +0 -0
  37. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/py.typed +0 -0
  38. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat/rest.py +0 -0
  39. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat.egg-info/SOURCES.txt +0 -0
  40. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat.egg-info/dependency_links.txt +0 -0
  41. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat.egg-info/requires.txt +0 -0
  42. {weheat-2024.9.10rc2 → weheat-2024.9.23}/weheat.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: weheat
3
- Version: 2024.9.10rc2
3
+ Version: 2024.9.23
4
4
  Summary: Weheat Backend client
5
5
  Home-page: https://github.com/wefabricate/wh-python
6
6
  Author: Jesper Raemaekers
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "weheat"
3
- version = "2024.09.10rc2"
3
+ version = "2024.09.23"
4
4
  description = "Weheat Backend"
5
5
  authors = ["Jesper Raemaekers <jesper.raemaekers@wefabricate.com>", "Kjell van Straaten <kjell.van.straaten@wefabricate.com>"]
6
6
  license = "MIT"
@@ -21,7 +21,7 @@ from setuptools import setup, find_packages # noqa: H301
21
21
  # prerequisite: setuptools
22
22
  # http://pypi.python.org/pypi/setuptools
23
23
  NAME = "weheat"
24
- VERSION = "2024.09.10rc2"
24
+ VERSION = "2024.09.23"
25
25
  PYTHON_REQUIRES = ">=3.7"
26
26
  REQUIRES = [
27
27
  "urllib3 >= 1.25.3, < 2.1.0",
@@ -26,11 +26,21 @@ class HeatPumpDiscovery:
26
26
  response = HeatPumpApi(client).api_v1_heat_pumps_get_with_http_info('', 0, 1000, DeviceState.NUMBER_3 ,async_req=True).get()
27
27
  if response.status_code == 200:
28
28
  for pump in response.data:
29
- model_string = "BlackBird P80 heat pump"
29
+ # Model of the heat pump
30
+ # - BlackBirdP80: BlackBird P80 heat pump (0)
31
+ # - BlackBirdP60: BlackBird P60 heat pump (1)
32
+ # - SparrowP60Brown: Sparrow P60 heat pump, colour brown (default) (2)
33
+ # - SparrowP60Green: Sparrow P60 heat pump, colour green (3)
34
+ # - SparrowP60Grey: Sparrow P60 heat pump, colour grey (4)
35
+ # - FlintP40: Flint P40 heat pump (5)
36
+ model_string = "Blackbird P80 heat pump"
30
37
  if pump.model == 1:
31
- model_string = "BlackBird P60 heat pump"
32
- elif pump.model == 2:
38
+ model_string = "Blackbird P60 heat pump"
39
+ elif 2 <= pump.model <= 4:
33
40
  model_string = "Sparrow P60 heat pump"
41
+ elif pump.model == 5:
42
+ model_string = "Flint P40 heat pump"
43
+
34
44
 
35
45
  dhw = False
36
46
  if pump.dhw_type is not None and pump.dhw_type == 1:
@@ -1,3 +1,4 @@
1
+ """Weheat heat pump abstraction from the API."""
1
2
  from enum import Enum, auto
2
3
  from weheat.configuration import Configuration
3
4
  from weheat.api_client import ApiClient
@@ -5,10 +6,12 @@ from weheat.api.heat_pump_log_api import HeatPumpLogApi
5
6
  from weheat.api.energy_log_api import EnergyLogApi
6
7
  from datetime import datetime, timedelta
7
8
 
8
- START_DATE = datetime(2024, 1, 1, 0, 0, 0)
9
+ # before this date no energy logs are available, so start from this point onwards
10
+ START_DATE = datetime(2023, 1, 1, 0, 0, 0)
9
11
 
10
12
 
11
13
  class HeatPump:
14
+ """Heat pump class representing a heat pump."""
12
15
  class State(Enum):
13
16
  STANDBY = auto()
14
17
  WATER_CHECK = auto()
@@ -27,6 +30,7 @@ class HeatPump:
27
30
  self._energy_consumption = None
28
31
 
29
32
  def get_status(self, access_token: str):
33
+ """Updates the heat pump instance with data from the API."""
30
34
  try:
31
35
  config = Configuration(host=self._api_url, access_token=access_token)
32
36
 
@@ -55,18 +59,16 @@ class HeatPump:
55
59
  self._energy_consumption += year.total_ein_heating_defrost
56
60
  self._energy_consumption += year.total_ein_dhw
57
61
  self._energy_consumption += year.total_ein_dhw_defrost
58
- print(f'Summed for {self._uuid}: {self._energy_consumption}')
59
62
 
60
63
 
61
64
 
62
65
  except Exception as e:
63
66
  self._last_log = None
67
+ self._energy_consumption = None
64
68
  raise e
65
69
 
66
- def _update_properties(self):
67
- pass
68
-
69
70
  def _if_available(self, key):
71
+ """Returns the value from the last logged value if available. None otherwise."""
70
72
  if self._last_log is not None and hasattr(self._last_log, key):
71
73
  return getattr(self._last_log, key)
72
74
  return None
@@ -79,54 +81,67 @@ class HeatPump:
79
81
 
80
82
  @property
81
83
  def water_inlet_temperature(self):
84
+ """The heat pump water inlet temperature."""
82
85
  return self._if_available("t_water_in")
83
86
 
84
87
  @property
85
88
  def water_outlet_temperature(self):
89
+ """The heat pump water outlet temperature."""
86
90
  return self._if_available("t_water_out")
87
91
 
88
92
  @property
89
93
  def water_house_in_temperature(self):
94
+ """The water house in temperature."""
90
95
  return self._if_available("t_water_house_in")
91
96
 
92
97
  @property
93
98
  def air_inlet_temperature(self):
99
+ """The heat pump air inlet temperature."""
94
100
  return self._if_available("t_air_in")
95
101
 
96
102
  @property
97
103
  def air_outlet_temperature(self):
104
+ """The heat pump air outlet temperature."""
98
105
  return self._if_available("t_air_out")
99
106
 
100
107
  @property
101
108
  def thermostat_water_setpoint(self):
109
+ """The thermostat water setpoint."""
102
110
  return self._if_available("t_thermostat_setpoint")
103
111
 
104
112
  @property
105
113
  def thermostat_room_temperature(self):
114
+ """The thermostat current room temperature."""
106
115
  return self._if_available("t_room")
107
116
 
108
117
  @property
109
118
  def thermostat_room_temperature_setpoint(self):
119
+ """The thermostat room temperature setpoint."""
110
120
  return self._if_available("t_room_target")
111
121
 
112
122
  @property
113
123
  def thermostat_on_off_state(self):
124
+ """The thermostat on/off state."""
114
125
  return self._if_available("on_off_thermostat_state")
115
126
 
116
127
  @property
117
128
  def power_input(self):
129
+ """The heat pumps power input."""
118
130
  return self._if_available("cm_mass_power_in")
119
131
 
120
132
  @property
121
133
  def power_output(self):
134
+ """The heat pumps hydraulic output power."""
122
135
  return self._if_available("cm_mass_power_out")
123
136
 
124
137
  @property
125
138
  def dhw_top_temperature(self):
139
+ """The DHW vessel top temperature."""
126
140
  return self._if_available("t1")
127
141
 
128
142
  @property
129
143
  def dhw_bottom_temperature(self):
144
+ """The DHW vessel bottom temperature."""
130
145
  return self._if_available("t2")
131
146
 
132
147
  @property
@@ -143,22 +158,27 @@ class HeatPump:
143
158
 
144
159
  @property
145
160
  def inside_unit_water_pump_state(self):
161
+ """Decoded water pump state."""
146
162
  return self._if_available("control_bridge_status_decoded_water_pump")
147
163
 
148
164
  @property
149
165
  def inside_unit_auxilary_pump_state(self):
166
+ """Decoded auxilary pump state."""
150
167
  return self._if_available("control_bridge_status_decoded_water_pump2")
151
168
 
152
169
  @property
153
170
  def inside_unit_dhw_valve_or_pump_state(self):
171
+ """Decoded DHW valve or pump state."""
154
172
  return self._if_available("control_bridge_status_decoded_dhw_valve")
155
173
 
156
174
  @property
157
175
  def inside_unit_gas_boiler_state(self):
176
+ """Decoded gas boiler state."""
158
177
  return self._if_available("control_bridge_status_decoded_gas_boiler")
159
178
 
160
179
  @property
161
180
  def heat_pump_state(self) -> State | None:
181
+ """The heat pump state."""
162
182
  numeric_state = self._if_available("state")
163
183
  if numeric_state is None:
164
184
  return None
@@ -183,4 +203,5 @@ class HeatPump:
183
203
 
184
204
  @property
185
205
  def energy_total(self):
206
+ """The total used energy in kWh from 2023 to now."""
186
207
  return self._energy_consumption
@@ -23,7 +23,7 @@ from aenum import Enum, no_arg
23
23
 
24
24
  class HeatPumpModel(int, Enum):
25
25
  """
26
- Model of the heat pump - BlackBirdP80: BlackBird P80 heat pump (0) - BlackBirdP60: BlackBird P60 heat pump (1) - SparrowP60: Sparrow P60 heat pump (2)
26
+ Model of the heat pump - BlackBirdP80: BlackBird P80 heat pump (0) - BlackBirdP60: BlackBird P60 heat pump (1) - SparrowP60Brown: Sparrow P60 heat pump, colour brown (default) (2) - SparrowP60Green: Sparrow P60 heat pump, colour green (3) - SparrowP60Grey: Sparrow P60 heat pump, colour grey (4) - FlintP40: Flint P40 heat pump (5)
27
27
  """
28
28
 
29
29
  """
@@ -32,6 +32,9 @@ class HeatPumpModel(int, Enum):
32
32
  NUMBER_0 = 0
33
33
  NUMBER_1 = 1
34
34
  NUMBER_2 = 2
35
+ NUMBER_3 = 3
36
+ NUMBER_4 = 4
37
+ NUMBER_5 = 5
35
38
 
36
39
  @classmethod
37
40
  def from_json(cls, json_str: str) -> HeatPumpModel:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: weheat
3
- Version: 2024.9.10rc2
3
+ Version: 2024.9.23
4
4
  Summary: Weheat Backend client
5
5
  Home-page: https://github.com/wefabricate/wh-python
6
6
  Author: Jesper Raemaekers
File without changes
File without changes
File without changes
File without changes