weheat 2024.9.10__py3-none-any.whl → 2024.9.10rc2__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.

Potentially problematic release.


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

@@ -1,4 +1,3 @@
1
- """Weheat heat pump abstraction from the API."""
2
1
  from enum import Enum, auto
3
2
  from weheat.configuration import Configuration
4
3
  from weheat.api_client import ApiClient
@@ -6,12 +5,10 @@ from weheat.api.heat_pump_log_api import HeatPumpLogApi
6
5
  from weheat.api.energy_log_api import EnergyLogApi
7
6
  from datetime import datetime, timedelta
8
7
 
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)
8
+ START_DATE = datetime(2024, 1, 1, 0, 0, 0)
11
9
 
12
10
 
13
11
  class HeatPump:
14
- """Heat pump class representing a heat pump."""
15
12
  class State(Enum):
16
13
  STANDBY = auto()
17
14
  WATER_CHECK = auto()
@@ -30,7 +27,6 @@ class HeatPump:
30
27
  self._energy_consumption = None
31
28
 
32
29
  def get_status(self, access_token: str):
33
- """Updates the heat pump instance with data from the API."""
34
30
  try:
35
31
  config = Configuration(host=self._api_url, access_token=access_token)
36
32
 
@@ -59,16 +55,18 @@ class HeatPump:
59
55
  self._energy_consumption += year.total_ein_heating_defrost
60
56
  self._energy_consumption += year.total_ein_dhw
61
57
  self._energy_consumption += year.total_ein_dhw_defrost
58
+ print(f'Summed for {self._uuid}: {self._energy_consumption}')
62
59
 
63
60
 
64
61
 
65
62
  except Exception as e:
66
63
  self._last_log = None
67
- self._energy_consumption = None
68
64
  raise e
69
65
 
66
+ def _update_properties(self):
67
+ pass
68
+
70
69
  def _if_available(self, key):
71
- """Returns the value from the last logged value if available. None otherwise."""
72
70
  if self._last_log is not None and hasattr(self._last_log, key):
73
71
  return getattr(self._last_log, key)
74
72
  return None
@@ -81,67 +79,54 @@ class HeatPump:
81
79
 
82
80
  @property
83
81
  def water_inlet_temperature(self):
84
- """The heat pump water inlet temperature."""
85
82
  return self._if_available("t_water_in")
86
83
 
87
84
  @property
88
85
  def water_outlet_temperature(self):
89
- """The heat pump water outlet temperature."""
90
86
  return self._if_available("t_water_out")
91
87
 
92
88
  @property
93
89
  def water_house_in_temperature(self):
94
- """The water house in temperature."""
95
90
  return self._if_available("t_water_house_in")
96
91
 
97
92
  @property
98
93
  def air_inlet_temperature(self):
99
- """The heat pump air inlet temperature."""
100
94
  return self._if_available("t_air_in")
101
95
 
102
96
  @property
103
97
  def air_outlet_temperature(self):
104
- """The heat pump air outlet temperature."""
105
98
  return self._if_available("t_air_out")
106
99
 
107
100
  @property
108
101
  def thermostat_water_setpoint(self):
109
- """The thermostat water setpoint."""
110
102
  return self._if_available("t_thermostat_setpoint")
111
103
 
112
104
  @property
113
105
  def thermostat_room_temperature(self):
114
- """The thermostat current room temperature."""
115
106
  return self._if_available("t_room")
116
107
 
117
108
  @property
118
109
  def thermostat_room_temperature_setpoint(self):
119
- """The thermostat room temperature setpoint."""
120
110
  return self._if_available("t_room_target")
121
111
 
122
112
  @property
123
113
  def thermostat_on_off_state(self):
124
- """The thermostat on/off state."""
125
114
  return self._if_available("on_off_thermostat_state")
126
115
 
127
116
  @property
128
117
  def power_input(self):
129
- """The heat pumps power input."""
130
118
  return self._if_available("cm_mass_power_in")
131
119
 
132
120
  @property
133
121
  def power_output(self):
134
- """The heat pumps hydraulic output power."""
135
122
  return self._if_available("cm_mass_power_out")
136
123
 
137
124
  @property
138
125
  def dhw_top_temperature(self):
139
- """The DHW vessel top temperature."""
140
126
  return self._if_available("t1")
141
127
 
142
128
  @property
143
129
  def dhw_bottom_temperature(self):
144
- """The DHW vessel bottom temperature."""
145
130
  return self._if_available("t2")
146
131
 
147
132
  @property
@@ -158,27 +143,22 @@ class HeatPump:
158
143
 
159
144
  @property
160
145
  def inside_unit_water_pump_state(self):
161
- """Decoded water pump state."""
162
146
  return self._if_available("control_bridge_status_decoded_water_pump")
163
147
 
164
148
  @property
165
149
  def inside_unit_auxilary_pump_state(self):
166
- """Decoded auxilary pump state."""
167
150
  return self._if_available("control_bridge_status_decoded_water_pump2")
168
151
 
169
152
  @property
170
153
  def inside_unit_dhw_valve_or_pump_state(self):
171
- """Decoded DHW valve or pump state."""
172
154
  return self._if_available("control_bridge_status_decoded_dhw_valve")
173
155
 
174
156
  @property
175
157
  def inside_unit_gas_boiler_state(self):
176
- """Decoded gas boiler state."""
177
158
  return self._if_available("control_bridge_status_decoded_gas_boiler")
178
159
 
179
160
  @property
180
161
  def heat_pump_state(self) -> State | None:
181
- """The heat pump state."""
182
162
  numeric_state = self._if_available("state")
183
163
  if numeric_state is None:
184
164
  return None
@@ -203,5 +183,4 @@ class HeatPump:
203
183
 
204
184
  @property
205
185
  def energy_total(self):
206
- """The total used energy in kWh from 2023 to now."""
207
186
  return self._energy_consumption
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: weheat
3
- Version: 2024.9.10
3
+ Version: 2024.9.10rc2
4
4
  Summary: Weheat Backend client
5
5
  Home-page: https://github.com/wefabricate/wh-python
6
6
  Author: Jesper Raemaekers
@@ -8,7 +8,7 @@ weheat/rest.py,sha256=hLgJ0CYAR1Dr_LppodDNNC_chj5hEQUmzDmbxvID1ao,13808
8
8
  weheat/abstractions/__init__.py,sha256=cRdA_kyTIooo39I13_mqShSfZMqdzNGHbmrnITqgx6A,161
9
9
  weheat/abstractions/auth.py,sha256=VCAxJ4OIj7bsYttqJl5-juU0VUlSd3xPu7kUjtHZr3U,979
10
10
  weheat/abstractions/discovery.py,sha256=0HEXdtIuw3FIATUwX0xpeUVRnk8i-HRL21pE6b1mej0,1679
11
- weheat/abstractions/heat_pump.py,sha256=RuUJJSGA2Zb8zg0HY-FbIQilIJQyCqTimthxcIgiN1Q,7469
11
+ weheat/abstractions/heat_pump.py,sha256=ry9jBWXl9uX3SkCcyWI8YaPqvNu0CoDlEsHn_RXUq8U,6302
12
12
  weheat/abstractions/user.py,sha256=n1gmPaLKXmRjF1jDuMQ0951RkbBKm-Cx3cgUU2nOA9U,648
13
13
  weheat/api/__init__.py,sha256=DQnnRs5Z29Nf5sGdFd3f96xM6p_FMym-_-dvQC2VzdU,243
14
14
  weheat/api/energy_log_api.py,sha256=yIIqd-C_xHSM_1eNoj2i04IDkJkzU0-a9iFGDSd2zLo,11374
@@ -29,8 +29,8 @@ weheat/models/read_all_heat_pump_dto.py,sha256=PDaWb-2qSzAnMoIsNceHavT1ybIZa3-lv
29
29
  weheat/models/read_heat_pump_dto.py,sha256=ufDbcHxtB8o2jmk00bMP_xol3uCdoTOqiHS6UUzRic4,4514
30
30
  weheat/models/read_user_dto.py,sha256=J1YlL-WsXArbirllI1fHZrguKy5Wv35NIck59ICBSGg,3465
31
31
  weheat/models/role.py,sha256=eF6nawkz8mmCGQEmJx26Y2MPFmlKdpOOtJ2Q70b-Qtc,938
32
- weheat-2024.9.10.dist-info/LICENSE,sha256=rWmFUq0uth2jpet-RQ2QPd2VhZkcPSUs6Dxfmbqkbis,1068
33
- weheat-2024.9.10.dist-info/METADATA,sha256=7pvOua4tvtcqaL44AnNJ4RxKQdGAnORuq2LZKeafG1M,3901
34
- weheat-2024.9.10.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
35
- weheat-2024.9.10.dist-info/top_level.txt,sha256=hLzdyvGZ9rs4AqK7U48mdHx_-FcP5sDuTSleDUvGAZw,7
36
- weheat-2024.9.10.dist-info/RECORD,,
32
+ weheat-2024.9.10rc2.dist-info/LICENSE,sha256=rWmFUq0uth2jpet-RQ2QPd2VhZkcPSUs6Dxfmbqkbis,1068
33
+ weheat-2024.9.10rc2.dist-info/METADATA,sha256=D27bkCuZW0lWzgtGq0mXdxNlI-66Qt6fec9ilBamnFE,3904
34
+ weheat-2024.9.10rc2.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
35
+ weheat-2024.9.10rc2.dist-info/top_level.txt,sha256=hLzdyvGZ9rs4AqK7U48mdHx_-FcP5sDuTSleDUvGAZw,7
36
+ weheat-2024.9.10rc2.dist-info/RECORD,,