weheat 2024.9.10rc3__tar.gz → 2024.9.23rc1__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.10rc3/weheat.egg-info → weheat-2024.9.23rc1}/PKG-INFO +1 -1
  2. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/pyproject.toml +1 -1
  3. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/setup.py +1 -1
  4. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/abstractions/discovery.py +13 -3
  5. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/abstractions/heat_pump.py +26 -4
  6. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/models/heat_pump_model.py +4 -1
  7. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1/weheat.egg-info}/PKG-INFO +1 -1
  8. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/LICENSE +0 -0
  9. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/README.md +0 -0
  10. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/setup.cfg +0 -0
  11. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/__init__.py +0 -0
  12. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/abstractions/__init__.py +0 -0
  13. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/abstractions/auth.py +0 -0
  14. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/abstractions/user.py +0 -0
  15. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/api/__init__.py +0 -0
  16. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/api/energy_log_api.py +0 -0
  17. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/api/heat_pump_api.py +0 -0
  18. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/api/heat_pump_log_api.py +0 -0
  19. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/api/user_api.py +0 -0
  20. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/api_client.py +0 -0
  21. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/api_response.py +0 -0
  22. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/configuration.py +0 -0
  23. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/exceptions.py +0 -0
  24. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/models/__init__.py +0 -0
  25. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/models/boiler_type.py +0 -0
  26. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/models/device_state.py +0 -0
  27. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/models/dhw_type.py +0 -0
  28. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/models/energy_view_dto.py +0 -0
  29. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/models/heat_pump_log_view_dto.py +0 -0
  30. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/models/heat_pump_status_enum.py +0 -0
  31. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/models/heat_pump_type.py +0 -0
  32. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/models/raw_heat_pump_log_dto.py +0 -0
  33. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/models/read_all_heat_pump_dto.py +0 -0
  34. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/models/read_heat_pump_dto.py +0 -0
  35. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/models/read_user_dto.py +0 -0
  36. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/models/role.py +0 -0
  37. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/py.typed +0 -0
  38. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat/rest.py +0 -0
  39. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat.egg-info/SOURCES.txt +0 -0
  40. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat.egg-info/dependency_links.txt +0 -0
  41. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/weheat.egg-info/requires.txt +0 -0
  42. {weheat-2024.9.10rc3 → weheat-2024.9.23rc1}/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.10rc3
3
+ Version: 2024.9.23rc1
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.10rc3"
3
+ version = "2024.09.23rc1"
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.10rc3"
24
+ VERSION = "2024.09.23rc1"
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
 
@@ -60,12 +64,11 @@ class HeatPump:
60
64
 
61
65
  except Exception as e:
62
66
  self._last_log = None
67
+ self._energy_consumption = None
63
68
  raise e
64
69
 
65
- def _update_properties(self):
66
- pass
67
-
68
70
  def _if_available(self, key):
71
+ """Returns the value from the last logged value if available. None otherwise."""
69
72
  if self._last_log is not None and hasattr(self._last_log, key):
70
73
  return getattr(self._last_log, key)
71
74
  return None
@@ -78,54 +81,67 @@ class HeatPump:
78
81
 
79
82
  @property
80
83
  def water_inlet_temperature(self):
84
+ """The heat pump water inlet temperature."""
81
85
  return self._if_available("t_water_in")
82
86
 
83
87
  @property
84
88
  def water_outlet_temperature(self):
89
+ """The heat pump water outlet temperature."""
85
90
  return self._if_available("t_water_out")
86
91
 
87
92
  @property
88
93
  def water_house_in_temperature(self):
94
+ """The water house in temperature."""
89
95
  return self._if_available("t_water_house_in")
90
96
 
91
97
  @property
92
98
  def air_inlet_temperature(self):
99
+ """The heat pump air inlet temperature."""
93
100
  return self._if_available("t_air_in")
94
101
 
95
102
  @property
96
103
  def air_outlet_temperature(self):
104
+ """The heat pump air outlet temperature."""
97
105
  return self._if_available("t_air_out")
98
106
 
99
107
  @property
100
108
  def thermostat_water_setpoint(self):
109
+ """The thermostat water setpoint."""
101
110
  return self._if_available("t_thermostat_setpoint")
102
111
 
103
112
  @property
104
113
  def thermostat_room_temperature(self):
114
+ """The thermostat current room temperature."""
105
115
  return self._if_available("t_room")
106
116
 
107
117
  @property
108
118
  def thermostat_room_temperature_setpoint(self):
119
+ """The thermostat room temperature setpoint."""
109
120
  return self._if_available("t_room_target")
110
121
 
111
122
  @property
112
123
  def thermostat_on_off_state(self):
124
+ """The thermostat on/off state."""
113
125
  return self._if_available("on_off_thermostat_state")
114
126
 
115
127
  @property
116
128
  def power_input(self):
129
+ """The heat pumps power input."""
117
130
  return self._if_available("cm_mass_power_in")
118
131
 
119
132
  @property
120
133
  def power_output(self):
134
+ """The heat pumps hydraulic output power."""
121
135
  return self._if_available("cm_mass_power_out")
122
136
 
123
137
  @property
124
138
  def dhw_top_temperature(self):
139
+ """The DHW vessel top temperature."""
125
140
  return self._if_available("t1")
126
141
 
127
142
  @property
128
143
  def dhw_bottom_temperature(self):
144
+ """The DHW vessel bottom temperature."""
129
145
  return self._if_available("t2")
130
146
 
131
147
  @property
@@ -142,22 +158,27 @@ class HeatPump:
142
158
 
143
159
  @property
144
160
  def inside_unit_water_pump_state(self):
161
+ """Decoded water pump state."""
145
162
  return self._if_available("control_bridge_status_decoded_water_pump")
146
163
 
147
164
  @property
148
165
  def inside_unit_auxilary_pump_state(self):
166
+ """Decoded auxilary pump state."""
149
167
  return self._if_available("control_bridge_status_decoded_water_pump2")
150
168
 
151
169
  @property
152
170
  def inside_unit_dhw_valve_or_pump_state(self):
171
+ """Decoded DHW valve or pump state."""
153
172
  return self._if_available("control_bridge_status_decoded_dhw_valve")
154
173
 
155
174
  @property
156
175
  def inside_unit_gas_boiler_state(self):
176
+ """Decoded gas boiler state."""
157
177
  return self._if_available("control_bridge_status_decoded_gas_boiler")
158
178
 
159
179
  @property
160
180
  def heat_pump_state(self) -> State | None:
181
+ """The heat pump state."""
161
182
  numeric_state = self._if_available("state")
162
183
  if numeric_state is None:
163
184
  return None
@@ -182,4 +203,5 @@ class HeatPump:
182
203
 
183
204
  @property
184
205
  def energy_total(self):
206
+ """The total used energy in kWh from 2023 to now."""
185
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.10rc3
3
+ Version: 2024.9.23rc1
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