weheat 2025.1.14rc1__py3-none-any.whl → 2025.1.15rc2__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.

Files changed (36) hide show
  1. weheat/__init__.py +7 -2
  2. weheat/abstractions/discovery.py +6 -6
  3. weheat/abstractions/heat_pump.py +11 -15
  4. weheat/abstractions/user.py +7 -7
  5. weheat/api/__init__.py +1 -0
  6. weheat/api/energy_log_api.py +306 -132
  7. weheat/api/heat_pump_api.py +521 -369
  8. weheat/api/heat_pump_log_api.py +836 -359
  9. weheat/api/user_api.py +243 -115
  10. weheat/api_client.py +234 -261
  11. weheat/api_response.py +10 -18
  12. weheat/configuration.py +14 -9
  13. weheat/exceptions.py +59 -25
  14. weheat/models/__init__.py +6 -0
  15. weheat/models/boiler_type.py +8 -3
  16. weheat/models/device_state.py +9 -4
  17. weheat/models/dhw_type.py +8 -3
  18. weheat/models/energy_view_dto.py +81 -66
  19. weheat/models/heat_pump_log_view_dto.py +527 -481
  20. weheat/models/heat_pump_model.py +8 -3
  21. weheat/models/heat_pump_status_enum.py +8 -3
  22. weheat/models/heat_pump_type.py +8 -3
  23. weheat/models/raw_heat_pump_log_dto.py +353 -315
  24. weheat/models/read_all_heat_pump_dto.py +64 -48
  25. weheat/models/read_heat_pump_dto.py +59 -43
  26. weheat/models/read_user_dto.py +54 -39
  27. weheat/models/read_user_me_dto.py +124 -0
  28. weheat/models/role.py +10 -4
  29. weheat/rest.py +152 -259
  30. weheat-2025.1.15rc2.dist-info/METADATA +115 -0
  31. weheat-2025.1.15rc2.dist-info/RECORD +37 -0
  32. weheat-2025.1.14rc1.dist-info/METADATA +0 -117
  33. weheat-2025.1.14rc1.dist-info/RECORD +0 -36
  34. {weheat-2025.1.14rc1.dist-info → weheat-2025.1.15rc2.dist-info}/LICENSE +0 -0
  35. {weheat-2025.1.14rc1.dist-info → weheat-2025.1.15rc2.dist-info}/WHEEL +0 -0
  36. {weheat-2025.1.14rc1.dist-info → weheat-2025.1.15rc2.dist-info}/top_level.txt +0 -0
@@ -18,498 +18,536 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
  from datetime import datetime
21
- from typing import Optional, Union
21
+ from typing import Any, ClassVar, Dict, List, Optional, Union
22
+ from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr
23
+ from pydantic import Field
22
24
  try:
23
- from pydantic.v1 import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr
25
+ from typing import Self
24
26
  except ImportError:
25
- from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr
26
-
27
+ from typing_extensions import Self
27
28
 
28
29
  class RawHeatPumpLogDto(BaseModel):
29
30
  """
30
- Raw heat pump log as given by a heat pump (Required star states that it will always be there for any roll, otherwise it is filtered for customers) # noqa: E501
31
- """
32
- heat_pump_id: StrictStr = Field(..., alias="heatPumpId", description="Identifier of the Heat Pump")
33
- timestamp: datetime = Field(..., description="Timestamp of when this was logged to the server")
34
- firmware_revision: Optional[StrictInt] = Field(None, alias="firmwareRevision", description="Version of heat pump logs (should be 1026)")
35
- packet_counter: Optional[StrictInt] = Field(None, alias="packetCounter", description="Packet counter of inside the control board")
36
- unix_time_mcu: Optional[StrictInt] = Field(None, alias="unixTimeMcu", description="Unix time inside the control board at the time it send this log")
37
- state: Optional[StrictInt] = Field(None, description="Current heat pump state (which is decoded in the view)")
38
- rpm_ctrl: Optional[StrictInt] = Field(None, alias="rpmCtrl", description="Current mode of RPM control (which is decoded in the view)")
39
- error: Optional[StrictInt] = Field(None, description="Current state of error in the heat pump (which is decoded in the view)")
40
- error_decoded_dtc_none: Optional[StrictBool] = Field(None, alias="errorDecodedDtcNone", description="None state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)")
41
- error_decoded_dtc_continue: Optional[StrictBool] = Field(None, alias="errorDecodedDtcContinue", description="DTC continue state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)")
42
- error_decoded_dtc_compressor_off: Optional[StrictBool] = Field(None, alias="errorDecodedDtcCompressorOff", description="DTC off state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)")
43
- error_decoded_dtc_defrost_forbidden: Optional[StrictBool] = Field(None, alias="errorDecodedDtcDefrostForbidden", description="DTC defrost forbidden state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)")
44
- error_decoded_dtc_request_service: Optional[StrictBool] = Field(None, alias="errorDecodedDtcRequestService", description="DTC request service state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)")
45
- error_decoded_dtc_use_heating_curve: Optional[StrictBool] = Field(None, alias="errorDecodedDtcUseHeatingCurve", description="DTC use heating curve state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)")
46
- error_decoded_dtc_dhw_forbidden: Optional[StrictBool] = Field(None, alias="errorDecodedDtcDhwForbidden", description="DTC use heating curve state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)")
47
- error_decoded_dtc_error: Optional[StrictBool] = Field(None, alias="errorDecodedDtcError", description="DTC use heating curve state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)")
48
- error_decoded_dtc_inactive: Optional[StrictBool] = Field(None, alias="errorDecodedDtcInactive", description="DTC Inactive state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)")
49
- heatsink: Optional[StrictInt] = Field(None, description="Raw state of the where the heat pump is dumping it's heat")
50
- si5: Optional[StrictInt] = Field(None, description="Raw state of the heat pump")
51
- e80: Optional[StrictInt] = Field(None, description="Raw error code state 80 of the heat pump")
52
- e81: Optional[StrictInt] = Field(None, description="Raw error code state 81 of the heat pump")
53
- e84: Optional[StrictInt] = Field(None, description="Raw error code state 84 of the heat pump")
54
- e85: Optional[StrictInt] = Field(None, description="Raw error code state 85 of the heat pump")
55
- control_bridge_status: Optional[StrictInt] = Field(None, alias="controlBridgeStatus", description="Raw control bridge status of the heat pump (bitwise encoded)")
56
- control_bridge_status_decoded_water_pump: Optional[StrictBool] = Field(None, alias="controlBridgeStatusDecodedWaterPump", description="Water pump (requested) on/off flag of the control bridge status (0x01)")
57
- control_bridge_status_decoded_dhw_valve: Optional[StrictBool] = Field(None, alias="controlBridgeStatusDecodedDhwValve", description="DhwValve (requested) open/closed flag of the control bridge status (0x02) (DHW Only)")
58
- control_bridge_status_decoded_gas_boiler: Optional[StrictBool] = Field(None, alias="controlBridgeStatusDecodedGasBoiler", description="Gas boiler assistance (requested) on/off flag of the control bridge status (0x04) (Hybrid Only)")
59
- control_bridge_status_decoded_electric_heater: Optional[StrictBool] = Field(None, alias="controlBridgeStatusDecodedElectricHeater", description="Electric heater assistance (requested) on/off flag of the control bridge status (0x08) (DHW Only)")
60
- control_bridge_status_decoded_water_pump2: Optional[StrictBool] = Field(None, alias="controlBridgeStatusDecodedWaterPump2", description="Second water pump (requested) on/off flag of the control bridge status (0x010) (DHW Only)")
61
- input_status: Optional[StrictInt] = Field(None, alias="inputStatus", description="Raw input status of the heat pump")
62
- current_control_method: Optional[StrictInt] = Field(None, alias="currentControlMethod", description="Raw current control method state of the heat pump")
63
- signal_strength: Optional[StrictInt] = Field(None, alias="signalStrength", description="Signal strength (rssi) reported by the modem of the control board")
64
- t1: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="Temperature T1 (TOP) of the DHW sensors")
65
- t2: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="Temperature T2 (BOTTOM) of the DHW sensors")
66
- t_spare_ntc: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tSpareNtc", description="Spare temperature sensor (for DHW)")
67
- t_board: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tBoard", description="Temperature of the control board")
68
- t_air_in: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tAirIn", description="Temperature of the air going into the heat pump")
69
- t_air_out: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tAirOut", description="Temperature of the air going out of the heat pump")
70
- t_water_in: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tWaterIn", description="Temperature of the water going into the heat pump")
71
- t_water_out: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tWaterOut", description="Temperature of the water going out of the heat pump")
72
- t_water_house_in: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tWaterHouseIn", description="Temperature of the water going into the building")
73
- rpm: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="Rpm of the compressor")
74
- rpm_limiter: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="rpmLimiter", description="Rpm limit of the compressor")
75
- rpm_limiter_type: Optional[StrictInt] = Field(None, alias="rpmLimiterType", description="Type of why the rpm is limited")
76
- p_compressor_in: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="pCompressorIn", description="Pressure of the compressor of the side where air goes into the compressor")
77
- p_compressor_out: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="pCompressorOut", description="Pressure of the compressor of the side where air goes out of the compressor")
78
- p_compressor_in_target: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="pCompressorInTarget", description="Target pressure of the compressor of the side where air goes into the compressor")
79
- t_inverter: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tInverter", description="Temperature of the inverter")
80
- t_compressor_in: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tCompressorIn", description="Temperature of the compressor of the side where air goes into the compressor")
81
- t_compressor_out: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tCompressorOut", description="Temperature of the compressor of the side where air goes out of the compressor")
82
- t_compressor_in_transient: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tCompressorInTransient", description="Temperature transient of the compressor of the side where air goes into the compressor")
83
- t_compressor_out_transient: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tCompressorOutTransient", description="Temperature transient of the compressor of the side where air goes out of the compressor")
84
- delta_t_compressor_in_superheat: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="deltaTCompressorInSuperheat", description="Difference in temperature for superheat based on the compressor temperatures")
85
- compressor_power_low_accuracy: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="compressorPowerLowAccuracy", description="Power used by the compressor (low accuracy)")
86
- fan: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="State of the fan")
87
- fan_power: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="fanPower", description="Power used by the fan")
88
- valve: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="Position value of the valve")
89
- exv_flow_step_gain: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="exvFlowStepGain")
90
- cm_mass_flow: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="cmMassFlow", description="Flow of the water going through the heat pump")
91
- cm_mass_power_in: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="cmMassPowerIn", description="Power going into the heat pump")
92
- cm_mass_power_out: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="cmMassPowerOut", description="Power going out of the heat pump (in the form of usable heat)")
93
- p_requested: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="pRequested", description="Power requested by the heat pump")
94
- power_error_integral: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="powerErrorIntegral", description="Current value of the power error integral")
95
- on_off_thermostat_state: Optional[StrictInt] = Field(None, alias="onOffThermostatState", description="State of the on/off thermostat")
96
- thermostat_status: Optional[StrictInt] = Field(None, alias="thermostatStatus", description="Status of the OpenTherm thermostat")
97
- t_room: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tRoom", description="Temperature of the room given by the OpenTherm thermostat")
98
- t_room_target: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tRoomTarget", description="Target temperature of the room given by the OpenTherm thermostat")
99
- t_thermostat_setpoint: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tThermostatSetpoint", description="Setpoint temperature of the OpenTherm thermostat OR the water setpoint of the heat pump")
100
- ot_boiler_status: Optional[StrictInt] = Field(None, alias="otBoilerStatus", description="Status of the OpenTherm boiler")
101
- ot_boiler_feed_temperature: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="otBoilerFeedTemperature", description="Feed temperature of the OpenTherm boiler")
102
- ot_boiler_return_temperature: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="otBoilerReturnTemperature", description="Return temperature of the OpenTherm boiler")
103
- interval: StrictInt = Field(..., description="Interval for this log in seconds")
104
- __properties = ["heatPumpId", "timestamp", "firmwareRevision", "packetCounter", "unixTimeMcu", "state", "rpmCtrl", "error", "errorDecodedDtcNone", "errorDecodedDtcContinue", "errorDecodedDtcCompressorOff", "errorDecodedDtcDefrostForbidden", "errorDecodedDtcRequestService", "errorDecodedDtcUseHeatingCurve", "errorDecodedDtcDhwForbidden", "errorDecodedDtcError", "errorDecodedDtcInactive", "heatsink", "si5", "e80", "e81", "e84", "e85", "controlBridgeStatus", "controlBridgeStatusDecodedWaterPump", "controlBridgeStatusDecodedDhwValve", "controlBridgeStatusDecodedGasBoiler", "controlBridgeStatusDecodedElectricHeater", "controlBridgeStatusDecodedWaterPump2", "inputStatus", "currentControlMethod", "signalStrength", "t1", "t2", "tSpareNtc", "tBoard", "tAirIn", "tAirOut", "tWaterIn", "tWaterOut", "tWaterHouseIn", "rpm", "rpmLimiter", "rpmLimiterType", "pCompressorIn", "pCompressorOut", "pCompressorInTarget", "tInverter", "tCompressorIn", "tCompressorOut", "tCompressorInTransient", "tCompressorOutTransient", "deltaTCompressorInSuperheat", "compressorPowerLowAccuracy", "fan", "fanPower", "valve", "exvFlowStepGain", "cmMassFlow", "cmMassPowerIn", "cmMassPowerOut", "pRequested", "powerErrorIntegral", "onOffThermostatState", "thermostatStatus", "tRoom", "tRoomTarget", "tThermostatSetpoint", "otBoilerStatus", "otBoilerFeedTemperature", "otBoilerReturnTemperature", "interval"]
105
-
106
- class Config:
107
- """Pydantic configuration"""
108
- allow_population_by_field_name = True
109
- validate_assignment = True
31
+ Raw heat pump log as given by a heat pump (Required star states that it will always be there for any roll, otherwise it is filtered for customers)
32
+ """ # noqa: E501
33
+ heat_pump_id: StrictStr = Field(description="Identifier of the Heat Pump", alias="heatPumpId")
34
+ timestamp: datetime = Field(description="Timestamp of when this was logged to the server")
35
+ state: Optional[StrictInt] = Field(default=None, description="Current heat pump state (which is decoded in the view)")
36
+ rpm_ctrl: Optional[StrictInt] = Field(default=None, description="Current mode of RPM control (which is decoded in the view)", alias="rpmCtrl")
37
+ error: Optional[StrictInt] = Field(default=None, description="Current state of error in the heat pump (which is decoded in the view)")
38
+ error_decoded_dtc_none: Optional[StrictBool] = Field(default=None, description="None state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)", alias="errorDecodedDtcNone")
39
+ error_decoded_dtc_continue: Optional[StrictBool] = Field(default=None, description="DTC continue state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)", alias="errorDecodedDtcContinue")
40
+ error_decoded_dtc_compressor_off: Optional[StrictBool] = Field(default=None, description="DTC off state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)", alias="errorDecodedDtcCompressorOff")
41
+ error_decoded_dtc_defrost_forbidden: Optional[StrictBool] = Field(default=None, description="DTC defrost forbidden state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)", alias="errorDecodedDtcDefrostForbidden")
42
+ error_decoded_dtc_request_service: Optional[StrictBool] = Field(default=None, description="DTC request service state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)", alias="errorDecodedDtcRequestService")
43
+ error_decoded_dtc_use_heating_curve: Optional[StrictBool] = Field(default=None, description="DTC use heating curve state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)", alias="errorDecodedDtcUseHeatingCurve")
44
+ error_decoded_dtc_dhw_forbidden: Optional[StrictBool] = Field(default=None, description="DTC use heating curve state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)", alias="errorDecodedDtcDhwForbidden")
45
+ error_decoded_dtc_error: Optional[StrictBool] = Field(default=None, description="DTC use heating curve state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)", alias="errorDecodedDtcError")
46
+ error_decoded_dtc_inactive: Optional[StrictBool] = Field(default=None, description="DTC Inactive state of the error flag which isn't raw for practical timescale purposes (it was bitwise encoded)", alias="errorDecodedDtcInactive")
47
+ control_bridge_status: Optional[StrictInt] = Field(default=None, description="Raw control bridge status of the heat pump (bitwise encoded)", alias="controlBridgeStatus")
48
+ control_bridge_status_decoded_water_pump: Optional[StrictBool] = Field(default=None, description="Water pump (requested) on/off flag of the control bridge status (0x01)", alias="controlBridgeStatusDecodedWaterPump")
49
+ control_bridge_status_decoded_dhw_valve: Optional[StrictBool] = Field(default=None, description="DhwValve (requested) open/closed flag of the control bridge status (0x02) (DHW Only)", alias="controlBridgeStatusDecodedDhwValve")
50
+ control_bridge_status_decoded_gas_boiler: Optional[StrictBool] = Field(default=None, description="Gas boiler assistance (requested) on/off flag of the control bridge status (0x04) (Hybrid Only)", alias="controlBridgeStatusDecodedGasBoiler")
51
+ control_bridge_status_decoded_electric_heater: Optional[StrictBool] = Field(default=None, description="Electric heater assistance (requested) on/off flag of the control bridge status (0x08) (DHW Only)", alias="controlBridgeStatusDecodedElectricHeater")
52
+ control_bridge_status_decoded_water_pump2: Optional[StrictBool] = Field(default=None, description="Second water pump (requested) on/off flag of the control bridge status (0x010) (DHW Only)", alias="controlBridgeStatusDecodedWaterPump2")
53
+ input_status: Optional[StrictInt] = Field(default=None, description="Raw input status of the heat pump", alias="inputStatus")
54
+ current_control_method: Optional[StrictInt] = Field(default=None, description="Raw current control method state of the heat pump", alias="currentControlMethod")
55
+ signal_strength: Optional[StrictInt] = Field(default=None, description="Signal strength (rssi) reported by the modem of the control board", alias="signalStrength")
56
+ t1: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Temperature T1 (TOP) of the DHW sensors")
57
+ t2: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Temperature T2 (BOTTOM) of the DHW sensors")
58
+ t_spare_ntc: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Spare temperature sensor", alias="tSpareNtc")
59
+ t_board: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Temperature of the control board", alias="tBoard")
60
+ t_air_in: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Temperature of the air going into the heat pump", alias="tAirIn")
61
+ t_air_out: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Temperature of the air going out of the heat pump", alias="tAirOut")
62
+ t_water_in: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Temperature of the water going into the heat pump", alias="tWaterIn")
63
+ t_water_out: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Temperature of the water going out of the heat pump", alias="tWaterOut")
64
+ t_water_house_in: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Temperature of the water going into the building", alias="tWaterHouseIn")
65
+ rpm: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rpm of the compressor")
66
+ rpm_limiter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Rpm limit of the compressor", alias="rpmLimiter")
67
+ rpm_limiter_type: Optional[StrictInt] = Field(default=None, description="Type of why the rpm is limited", alias="rpmLimiterType")
68
+ p_compressor_in: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Pressure of the compressor of the side where air goes into the compressor", alias="pCompressorIn")
69
+ p_compressor_out: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Pressure of the compressor of the side where air goes out of the compressor", alias="pCompressorOut")
70
+ p_compressor_in_target: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Target pressure of the compressor of the side where air goes into the compressor", alias="pCompressorInTarget")
71
+ t_inverter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Temperature of the inverter", alias="tInverter")
72
+ t_compressor_in: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Temperature of the compressor of the side where air goes into the compressor", alias="tCompressorIn")
73
+ t_compressor_out: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Temperature of the compressor of the side where air goes out of the compressor", alias="tCompressorOut")
74
+ t_compressor_in_transient: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Temperature transient of the compressor of the side where air goes into the compressor", alias="tCompressorInTransient")
75
+ t_compressor_out_transient: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Temperature transient of the compressor of the side where air goes out of the compressor", alias="tCompressorOutTransient")
76
+ delta_t_compressor_in_superheat: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Difference in temperature for superheat based on the compressor temperatures", alias="deltaTCompressorInSuperheat")
77
+ compressor_power_low_accuracy: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Power used by the compressor (low accuracy)", alias="compressorPowerLowAccuracy")
78
+ fan: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="State of the fan")
79
+ fan_power: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Power used by the fan", alias="fanPower")
80
+ valve: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Position value of the valve")
81
+ cm_mass_power_in: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Power going into the heat pump", alias="cmMassPowerIn")
82
+ cm_mass_power_out: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Power going out of the heat pump (in the form of usable heat)", alias="cmMassPowerOut")
83
+ temperature_error_integral: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Current value of the temperature error integral", alias="temperatureErrorIntegral")
84
+ on_off_thermostat_state: Optional[StrictInt] = Field(default=None, description="State of the on/off thermostat", alias="onOffThermostatState")
85
+ thermostat_status: Optional[StrictInt] = Field(default=None, description="Status of the OpenTherm thermostat", alias="thermostatStatus")
86
+ t_room: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Temperature of the room given by the OpenTherm thermostat", alias="tRoom")
87
+ t_room_target: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Target temperature of the room given by the OpenTherm thermostat", alias="tRoomTarget")
88
+ t_thermostat_setpoint: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Setpoint temperature of the OpenTherm thermostat OR the water setpoint of the heat pump", alias="tThermostatSetpoint")
89
+ ot_boiler_status: Optional[StrictInt] = Field(default=None, description="Status of the OpenTherm boiler", alias="otBoilerStatus")
90
+ ot_boiler_feed_temperature: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Feed temperature of the OpenTherm boiler", alias="otBoilerFeedTemperature")
91
+ ot_boiler_return_temperature: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Return temperature of the OpenTherm boiler", alias="otBoilerReturnTemperature")
92
+ inverter_input_voltage: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Input voltage measured by the compressor inverter float - 4 bytes", alias="inverterInputVoltage")
93
+ central_heating_pwm_requested_duty_cycle: Optional[StrictInt] = Field(default=None, description="Requested duty cycle to pwm pump for central heating circuit", alias="centralHeatingPwmRequestedDutyCycle")
94
+ central_heating_flow: Optional[StrictInt] = Field(default=None, description="Duty cycle read by pwm pump for central heating circuit", alias="centralHeatingFlow")
95
+ dhw_pwm_requested_duty_cycle: Optional[StrictInt] = Field(default=None, description="Requested duty cycle to pwm pump for DHW circuit", alias="dhwPwmRequestedDutyCycle")
96
+ dhw_flow: Optional[StrictInt] = Field(default=None, description="Duty cycle read by pwm pump for DHW circuit", alias="dhwFlow")
97
+ indoor_unit_heater_temperature: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Temperature of the indoor unit heater", alias="indoorUnitHeaterTemperature")
98
+ indoor_unit_input_current: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Current of the indoor unit heater", alias="indoorUnitInputCurrent")
99
+ sinr: Optional[StrictInt] = Field(default=None, description="Signal to noise ratio of the modem of the control board (SINR)")
100
+ cooling_status: Optional[StrictInt] = Field(default=None, description="Current status of cooling With enum values: 0 = idle, 1 = starting, 2 = active, 3 = stopping", alias="coolingStatus")
101
+ debug_variable1: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Optional debug variable that can be set to anything in firmware and will be logged as a float float - 4 bytes", alias="debugVariable1")
102
+ debug_variable2: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Optional? debug variable that can be set to anything in firmware and will be logged as a float float - 4 bytes", alias="debugVariable2")
103
+ debug_variable3: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Optional debug variable that can be set to anything in firmware and will be logged as a float float - 4 bytes", alias="debugVariable3")
104
+ debug_variable4: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Optional debug variable that can be set to anything in firmware and will be logged as a float float - 4 bytes", alias="debugVariable4")
105
+ debug_variable5: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Optional debug variable that can be set to anything in firmware and will be logged as a float float - 4 bytes", alias="debugVariable5")
106
+ interval: StrictInt = Field(description="Interval for this log in seconds")
107
+ __properties: ClassVar[List[str]] = ["heatPumpId", "timestamp", "state", "rpmCtrl", "error", "errorDecodedDtcNone", "errorDecodedDtcContinue", "errorDecodedDtcCompressorOff", "errorDecodedDtcDefrostForbidden", "errorDecodedDtcRequestService", "errorDecodedDtcUseHeatingCurve", "errorDecodedDtcDhwForbidden", "errorDecodedDtcError", "errorDecodedDtcInactive", "controlBridgeStatus", "controlBridgeStatusDecodedWaterPump", "controlBridgeStatusDecodedDhwValve", "controlBridgeStatusDecodedGasBoiler", "controlBridgeStatusDecodedElectricHeater", "controlBridgeStatusDecodedWaterPump2", "inputStatus", "currentControlMethod", "signalStrength", "t1", "t2", "tSpareNtc", "tBoard", "tAirIn", "tAirOut", "tWaterIn", "tWaterOut", "tWaterHouseIn", "rpm", "rpmLimiter", "rpmLimiterType", "pCompressorIn", "pCompressorOut", "pCompressorInTarget", "tInverter", "tCompressorIn", "tCompressorOut", "tCompressorInTransient", "tCompressorOutTransient", "deltaTCompressorInSuperheat", "compressorPowerLowAccuracy", "fan", "fanPower", "valve", "cmMassPowerIn", "cmMassPowerOut", "temperatureErrorIntegral", "onOffThermostatState", "thermostatStatus", "tRoom", "tRoomTarget", "tThermostatSetpoint", "otBoilerStatus", "otBoilerFeedTemperature", "otBoilerReturnTemperature", "inverterInputVoltage", "centralHeatingPwmRequestedDutyCycle", "centralHeatingFlow", "dhwPwmRequestedDutyCycle", "dhwFlow", "indoorUnitHeaterTemperature", "indoorUnitInputCurrent", "sinr", "coolingStatus", "debugVariable1", "debugVariable2", "debugVariable3", "debugVariable4", "debugVariable5", "interval"]
108
+
109
+ model_config = {
110
+ "populate_by_name": True,
111
+ "validate_assignment": True,
112
+ "protected_namespaces": (),
113
+ }
114
+
110
115
 
111
116
  def to_str(self) -> str:
112
117
  """Returns the string representation of the model using alias"""
113
- return pprint.pformat(self.dict(by_alias=True))
118
+ return pprint.pformat(self.model_dump(by_alias=True))
114
119
 
115
120
  def to_json(self) -> str:
116
121
  """Returns the JSON representation of the model using alias"""
122
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
117
123
  return json.dumps(self.to_dict())
118
124
 
119
125
  @classmethod
120
- def from_json(cls, json_str: str) -> RawHeatPumpLogDto:
126
+ def from_json(cls, json_str: str) -> Self:
121
127
  """Create an instance of RawHeatPumpLogDto from a JSON string"""
122
128
  return cls.from_dict(json.loads(json_str))
123
129
 
124
- def to_dict(self):
125
- """Returns the dictionary representation of the model using alias"""
126
- _dict = self.dict(by_alias=True,
127
- exclude={
128
- },
129
- exclude_none=True)
130
- # set to None if firmware_revision (nullable) is None
131
- # and __fields_set__ contains the field
132
- if self.firmware_revision is None and "firmware_revision" in self.__fields_set__:
133
- _dict['firmwareRevision'] = None
134
-
135
- # set to None if packet_counter (nullable) is None
136
- # and __fields_set__ contains the field
137
- if self.packet_counter is None and "packet_counter" in self.__fields_set__:
138
- _dict['packetCounter'] = None
139
-
140
- # set to None if unix_time_mcu (nullable) is None
141
- # and __fields_set__ contains the field
142
- if self.unix_time_mcu is None and "unix_time_mcu" in self.__fields_set__:
143
- _dict['unixTimeMcu'] = None
130
+ def to_dict(self) -> Dict[str, Any]:
131
+ """Return the dictionary representation of the model using alias.
132
+
133
+ This has the following differences from calling pydantic's
134
+ `self.model_dump(by_alias=True)`:
135
+
136
+ * `None` is only added to the output dict for nullable fields that
137
+ were set at model initialization. Other fields with value `None`
138
+ are ignored.
139
+ """
140
+ _dict = self.model_dump(
141
+ by_alias=True,
142
+ exclude={
143
+ },
144
+ exclude_none=True,
145
+ )
146
+ # set to None if rpm_ctrl (nullable) is None
147
+ # and model_fields_set contains the field
148
+ if self.rpm_ctrl is None and "rpm_ctrl" in self.model_fields_set:
149
+ _dict['rpmCtrl'] = None
144
150
 
145
151
  # set to None if error (nullable) is None
146
- # and __fields_set__ contains the field
147
- if self.error is None and "error" in self.__fields_set__:
152
+ # and model_fields_set contains the field
153
+ if self.error is None and "error" in self.model_fields_set:
148
154
  _dict['error'] = None
149
155
 
150
156
  # set to None if error_decoded_dtc_none (nullable) is None
151
- # and __fields_set__ contains the field
152
- if self.error_decoded_dtc_none is None and "error_decoded_dtc_none" in self.__fields_set__:
157
+ # and model_fields_set contains the field
158
+ if self.error_decoded_dtc_none is None and "error_decoded_dtc_none" in self.model_fields_set:
153
159
  _dict['errorDecodedDtcNone'] = None
154
160
 
155
161
  # set to None if error_decoded_dtc_continue (nullable) is None
156
- # and __fields_set__ contains the field
157
- if self.error_decoded_dtc_continue is None and "error_decoded_dtc_continue" in self.__fields_set__:
162
+ # and model_fields_set contains the field
163
+ if self.error_decoded_dtc_continue is None and "error_decoded_dtc_continue" in self.model_fields_set:
158
164
  _dict['errorDecodedDtcContinue'] = None
159
165
 
160
166
  # set to None if error_decoded_dtc_compressor_off (nullable) is None
161
- # and __fields_set__ contains the field
162
- if self.error_decoded_dtc_compressor_off is None and "error_decoded_dtc_compressor_off" in self.__fields_set__:
167
+ # and model_fields_set contains the field
168
+ if self.error_decoded_dtc_compressor_off is None and "error_decoded_dtc_compressor_off" in self.model_fields_set:
163
169
  _dict['errorDecodedDtcCompressorOff'] = None
164
170
 
165
171
  # set to None if error_decoded_dtc_defrost_forbidden (nullable) is None
166
- # and __fields_set__ contains the field
167
- if self.error_decoded_dtc_defrost_forbidden is None and "error_decoded_dtc_defrost_forbidden" in self.__fields_set__:
172
+ # and model_fields_set contains the field
173
+ if self.error_decoded_dtc_defrost_forbidden is None and "error_decoded_dtc_defrost_forbidden" in self.model_fields_set:
168
174
  _dict['errorDecodedDtcDefrostForbidden'] = None
169
175
 
170
176
  # set to None if error_decoded_dtc_request_service (nullable) is None
171
- # and __fields_set__ contains the field
172
- if self.error_decoded_dtc_request_service is None and "error_decoded_dtc_request_service" in self.__fields_set__:
177
+ # and model_fields_set contains the field
178
+ if self.error_decoded_dtc_request_service is None and "error_decoded_dtc_request_service" in self.model_fields_set:
173
179
  _dict['errorDecodedDtcRequestService'] = None
174
180
 
175
181
  # set to None if error_decoded_dtc_use_heating_curve (nullable) is None
176
- # and __fields_set__ contains the field
177
- if self.error_decoded_dtc_use_heating_curve is None and "error_decoded_dtc_use_heating_curve" in self.__fields_set__:
182
+ # and model_fields_set contains the field
183
+ if self.error_decoded_dtc_use_heating_curve is None and "error_decoded_dtc_use_heating_curve" in self.model_fields_set:
178
184
  _dict['errorDecodedDtcUseHeatingCurve'] = None
179
185
 
180
186
  # set to None if error_decoded_dtc_dhw_forbidden (nullable) is None
181
- # and __fields_set__ contains the field
182
- if self.error_decoded_dtc_dhw_forbidden is None and "error_decoded_dtc_dhw_forbidden" in self.__fields_set__:
187
+ # and model_fields_set contains the field
188
+ if self.error_decoded_dtc_dhw_forbidden is None and "error_decoded_dtc_dhw_forbidden" in self.model_fields_set:
183
189
  _dict['errorDecodedDtcDhwForbidden'] = None
184
190
 
185
191
  # set to None if error_decoded_dtc_error (nullable) is None
186
- # and __fields_set__ contains the field
187
- if self.error_decoded_dtc_error is None and "error_decoded_dtc_error" in self.__fields_set__:
192
+ # and model_fields_set contains the field
193
+ if self.error_decoded_dtc_error is None and "error_decoded_dtc_error" in self.model_fields_set:
188
194
  _dict['errorDecodedDtcError'] = None
189
195
 
190
196
  # set to None if error_decoded_dtc_inactive (nullable) is None
191
- # and __fields_set__ contains the field
192
- if self.error_decoded_dtc_inactive is None and "error_decoded_dtc_inactive" in self.__fields_set__:
197
+ # and model_fields_set contains the field
198
+ if self.error_decoded_dtc_inactive is None and "error_decoded_dtc_inactive" in self.model_fields_set:
193
199
  _dict['errorDecodedDtcInactive'] = None
194
200
 
195
- # set to None if heatsink (nullable) is None
196
- # and __fields_set__ contains the field
197
- if self.heatsink is None and "heatsink" in self.__fields_set__:
198
- _dict['heatsink'] = None
199
-
200
- # set to None if si5 (nullable) is None
201
- # and __fields_set__ contains the field
202
- if self.si5 is None and "si5" in self.__fields_set__:
203
- _dict['si5'] = None
204
-
205
- # set to None if e80 (nullable) is None
206
- # and __fields_set__ contains the field
207
- if self.e80 is None and "e80" in self.__fields_set__:
208
- _dict['e80'] = None
209
-
210
- # set to None if e81 (nullable) is None
211
- # and __fields_set__ contains the field
212
- if self.e81 is None and "e81" in self.__fields_set__:
213
- _dict['e81'] = None
214
-
215
- # set to None if e84 (nullable) is None
216
- # and __fields_set__ contains the field
217
- if self.e84 is None and "e84" in self.__fields_set__:
218
- _dict['e84'] = None
219
-
220
- # set to None if e85 (nullable) is None
221
- # and __fields_set__ contains the field
222
- if self.e85 is None and "e85" in self.__fields_set__:
223
- _dict['e85'] = None
224
-
225
201
  # set to None if control_bridge_status (nullable) is None
226
- # and __fields_set__ contains the field
227
- if self.control_bridge_status is None and "control_bridge_status" in self.__fields_set__:
202
+ # and model_fields_set contains the field
203
+ if self.control_bridge_status is None and "control_bridge_status" in self.model_fields_set:
228
204
  _dict['controlBridgeStatus'] = None
229
205
 
230
206
  # set to None if control_bridge_status_decoded_water_pump (nullable) is None
231
- # and __fields_set__ contains the field
232
- if self.control_bridge_status_decoded_water_pump is None and "control_bridge_status_decoded_water_pump" in self.__fields_set__:
207
+ # and model_fields_set contains the field
208
+ if self.control_bridge_status_decoded_water_pump is None and "control_bridge_status_decoded_water_pump" in self.model_fields_set:
233
209
  _dict['controlBridgeStatusDecodedWaterPump'] = None
234
210
 
235
211
  # set to None if control_bridge_status_decoded_dhw_valve (nullable) is None
236
- # and __fields_set__ contains the field
237
- if self.control_bridge_status_decoded_dhw_valve is None and "control_bridge_status_decoded_dhw_valve" in self.__fields_set__:
212
+ # and model_fields_set contains the field
213
+ if self.control_bridge_status_decoded_dhw_valve is None and "control_bridge_status_decoded_dhw_valve" in self.model_fields_set:
238
214
  _dict['controlBridgeStatusDecodedDhwValve'] = None
239
215
 
240
216
  # set to None if control_bridge_status_decoded_gas_boiler (nullable) is None
241
- # and __fields_set__ contains the field
242
- if self.control_bridge_status_decoded_gas_boiler is None and "control_bridge_status_decoded_gas_boiler" in self.__fields_set__:
217
+ # and model_fields_set contains the field
218
+ if self.control_bridge_status_decoded_gas_boiler is None and "control_bridge_status_decoded_gas_boiler" in self.model_fields_set:
243
219
  _dict['controlBridgeStatusDecodedGasBoiler'] = None
244
220
 
245
221
  # set to None if control_bridge_status_decoded_electric_heater (nullable) is None
246
- # and __fields_set__ contains the field
247
- if self.control_bridge_status_decoded_electric_heater is None and "control_bridge_status_decoded_electric_heater" in self.__fields_set__:
222
+ # and model_fields_set contains the field
223
+ if self.control_bridge_status_decoded_electric_heater is None and "control_bridge_status_decoded_electric_heater" in self.model_fields_set:
248
224
  _dict['controlBridgeStatusDecodedElectricHeater'] = None
249
225
 
250
226
  # set to None if control_bridge_status_decoded_water_pump2 (nullable) is None
251
- # and __fields_set__ contains the field
252
- if self.control_bridge_status_decoded_water_pump2 is None and "control_bridge_status_decoded_water_pump2" in self.__fields_set__:
227
+ # and model_fields_set contains the field
228
+ if self.control_bridge_status_decoded_water_pump2 is None and "control_bridge_status_decoded_water_pump2" in self.model_fields_set:
253
229
  _dict['controlBridgeStatusDecodedWaterPump2'] = None
254
230
 
255
231
  # set to None if input_status (nullable) is None
256
- # and __fields_set__ contains the field
257
- if self.input_status is None and "input_status" in self.__fields_set__:
232
+ # and model_fields_set contains the field
233
+ if self.input_status is None and "input_status" in self.model_fields_set:
258
234
  _dict['inputStatus'] = None
259
235
 
260
236
  # set to None if current_control_method (nullable) is None
261
- # and __fields_set__ contains the field
262
- if self.current_control_method is None and "current_control_method" in self.__fields_set__:
237
+ # and model_fields_set contains the field
238
+ if self.current_control_method is None and "current_control_method" in self.model_fields_set:
263
239
  _dict['currentControlMethod'] = None
264
240
 
265
241
  # set to None if signal_strength (nullable) is None
266
- # and __fields_set__ contains the field
267
- if self.signal_strength is None and "signal_strength" in self.__fields_set__:
242
+ # and model_fields_set contains the field
243
+ if self.signal_strength is None and "signal_strength" in self.model_fields_set:
268
244
  _dict['signalStrength'] = None
269
245
 
270
246
  # set to None if t1 (nullable) is None
271
- # and __fields_set__ contains the field
272
- if self.t1 is None and "t1" in self.__fields_set__:
247
+ # and model_fields_set contains the field
248
+ if self.t1 is None and "t1" in self.model_fields_set:
273
249
  _dict['t1'] = None
274
250
 
275
251
  # set to None if t2 (nullable) is None
276
- # and __fields_set__ contains the field
277
- if self.t2 is None and "t2" in self.__fields_set__:
252
+ # and model_fields_set contains the field
253
+ if self.t2 is None and "t2" in self.model_fields_set:
278
254
  _dict['t2'] = None
279
255
 
280
256
  # set to None if t_spare_ntc (nullable) is None
281
- # and __fields_set__ contains the field
282
- if self.t_spare_ntc is None and "t_spare_ntc" in self.__fields_set__:
257
+ # and model_fields_set contains the field
258
+ if self.t_spare_ntc is None and "t_spare_ntc" in self.model_fields_set:
283
259
  _dict['tSpareNtc'] = None
284
260
 
285
261
  # set to None if t_board (nullable) is None
286
- # and __fields_set__ contains the field
287
- if self.t_board is None and "t_board" in self.__fields_set__:
262
+ # and model_fields_set contains the field
263
+ if self.t_board is None and "t_board" in self.model_fields_set:
288
264
  _dict['tBoard'] = None
289
265
 
266
+ # set to None if t_air_out (nullable) is None
267
+ # and model_fields_set contains the field
268
+ if self.t_air_out is None and "t_air_out" in self.model_fields_set:
269
+ _dict['tAirOut'] = None
270
+
290
271
  # set to None if rpm (nullable) is None
291
- # and __fields_set__ contains the field
292
- if self.rpm is None and "rpm" in self.__fields_set__:
272
+ # and model_fields_set contains the field
273
+ if self.rpm is None and "rpm" in self.model_fields_set:
293
274
  _dict['rpm'] = None
294
275
 
295
276
  # set to None if rpm_limiter (nullable) is None
296
- # and __fields_set__ contains the field
297
- if self.rpm_limiter is None and "rpm_limiter" in self.__fields_set__:
277
+ # and model_fields_set contains the field
278
+ if self.rpm_limiter is None and "rpm_limiter" in self.model_fields_set:
298
279
  _dict['rpmLimiter'] = None
299
280
 
300
281
  # set to None if rpm_limiter_type (nullable) is None
301
- # and __fields_set__ contains the field
302
- if self.rpm_limiter_type is None and "rpm_limiter_type" in self.__fields_set__:
282
+ # and model_fields_set contains the field
283
+ if self.rpm_limiter_type is None and "rpm_limiter_type" in self.model_fields_set:
303
284
  _dict['rpmLimiterType'] = None
304
285
 
305
286
  # set to None if p_compressor_in (nullable) is None
306
- # and __fields_set__ contains the field
307
- if self.p_compressor_in is None and "p_compressor_in" in self.__fields_set__:
287
+ # and model_fields_set contains the field
288
+ if self.p_compressor_in is None and "p_compressor_in" in self.model_fields_set:
308
289
  _dict['pCompressorIn'] = None
309
290
 
310
291
  # set to None if p_compressor_out (nullable) is None
311
- # and __fields_set__ contains the field
312
- if self.p_compressor_out is None and "p_compressor_out" in self.__fields_set__:
292
+ # and model_fields_set contains the field
293
+ if self.p_compressor_out is None and "p_compressor_out" in self.model_fields_set:
313
294
  _dict['pCompressorOut'] = None
314
295
 
315
296
  # set to None if p_compressor_in_target (nullable) is None
316
- # and __fields_set__ contains the field
317
- if self.p_compressor_in_target is None and "p_compressor_in_target" in self.__fields_set__:
297
+ # and model_fields_set contains the field
298
+ if self.p_compressor_in_target is None and "p_compressor_in_target" in self.model_fields_set:
318
299
  _dict['pCompressorInTarget'] = None
319
300
 
320
301
  # set to None if t_inverter (nullable) is None
321
- # and __fields_set__ contains the field
322
- if self.t_inverter is None and "t_inverter" in self.__fields_set__:
302
+ # and model_fields_set contains the field
303
+ if self.t_inverter is None and "t_inverter" in self.model_fields_set:
323
304
  _dict['tInverter'] = None
324
305
 
325
306
  # set to None if t_compressor_in (nullable) is None
326
- # and __fields_set__ contains the field
327
- if self.t_compressor_in is None and "t_compressor_in" in self.__fields_set__:
307
+ # and model_fields_set contains the field
308
+ if self.t_compressor_in is None and "t_compressor_in" in self.model_fields_set:
328
309
  _dict['tCompressorIn'] = None
329
310
 
330
311
  # set to None if t_compressor_out (nullable) is None
331
- # and __fields_set__ contains the field
332
- if self.t_compressor_out is None and "t_compressor_out" in self.__fields_set__:
312
+ # and model_fields_set contains the field
313
+ if self.t_compressor_out is None and "t_compressor_out" in self.model_fields_set:
333
314
  _dict['tCompressorOut'] = None
334
315
 
335
316
  # set to None if t_compressor_in_transient (nullable) is None
336
- # and __fields_set__ contains the field
337
- if self.t_compressor_in_transient is None and "t_compressor_in_transient" in self.__fields_set__:
317
+ # and model_fields_set contains the field
318
+ if self.t_compressor_in_transient is None and "t_compressor_in_transient" in self.model_fields_set:
338
319
  _dict['tCompressorInTransient'] = None
339
320
 
340
321
  # set to None if t_compressor_out_transient (nullable) is None
341
- # and __fields_set__ contains the field
342
- if self.t_compressor_out_transient is None and "t_compressor_out_transient" in self.__fields_set__:
322
+ # and model_fields_set contains the field
323
+ if self.t_compressor_out_transient is None and "t_compressor_out_transient" in self.model_fields_set:
343
324
  _dict['tCompressorOutTransient'] = None
344
325
 
345
326
  # set to None if delta_t_compressor_in_superheat (nullable) is None
346
- # and __fields_set__ contains the field
347
- if self.delta_t_compressor_in_superheat is None and "delta_t_compressor_in_superheat" in self.__fields_set__:
327
+ # and model_fields_set contains the field
328
+ if self.delta_t_compressor_in_superheat is None and "delta_t_compressor_in_superheat" in self.model_fields_set:
348
329
  _dict['deltaTCompressorInSuperheat'] = None
349
330
 
350
331
  # set to None if compressor_power_low_accuracy (nullable) is None
351
- # and __fields_set__ contains the field
352
- if self.compressor_power_low_accuracy is None and "compressor_power_low_accuracy" in self.__fields_set__:
332
+ # and model_fields_set contains the field
333
+ if self.compressor_power_low_accuracy is None and "compressor_power_low_accuracy" in self.model_fields_set:
353
334
  _dict['compressorPowerLowAccuracy'] = None
354
335
 
355
336
  # set to None if fan (nullable) is None
356
- # and __fields_set__ contains the field
357
- if self.fan is None and "fan" in self.__fields_set__:
337
+ # and model_fields_set contains the field
338
+ if self.fan is None and "fan" in self.model_fields_set:
358
339
  _dict['fan'] = None
359
340
 
360
341
  # set to None if fan_power (nullable) is None
361
- # and __fields_set__ contains the field
362
- if self.fan_power is None and "fan_power" in self.__fields_set__:
342
+ # and model_fields_set contains the field
343
+ if self.fan_power is None and "fan_power" in self.model_fields_set:
363
344
  _dict['fanPower'] = None
364
345
 
365
346
  # set to None if valve (nullable) is None
366
- # and __fields_set__ contains the field
367
- if self.valve is None and "valve" in self.__fields_set__:
347
+ # and model_fields_set contains the field
348
+ if self.valve is None and "valve" in self.model_fields_set:
368
349
  _dict['valve'] = None
369
350
 
370
- # set to None if exv_flow_step_gain (nullable) is None
371
- # and __fields_set__ contains the field
372
- if self.exv_flow_step_gain is None and "exv_flow_step_gain" in self.__fields_set__:
373
- _dict['exvFlowStepGain'] = None
374
-
375
- # set to None if cm_mass_flow (nullable) is None
376
- # and __fields_set__ contains the field
377
- if self.cm_mass_flow is None and "cm_mass_flow" in self.__fields_set__:
378
- _dict['cmMassFlow'] = None
379
-
380
351
  # set to None if cm_mass_power_in (nullable) is None
381
- # and __fields_set__ contains the field
382
- if self.cm_mass_power_in is None and "cm_mass_power_in" in self.__fields_set__:
352
+ # and model_fields_set contains the field
353
+ if self.cm_mass_power_in is None and "cm_mass_power_in" in self.model_fields_set:
383
354
  _dict['cmMassPowerIn'] = None
384
355
 
385
356
  # set to None if cm_mass_power_out (nullable) is None
386
- # and __fields_set__ contains the field
387
- if self.cm_mass_power_out is None and "cm_mass_power_out" in self.__fields_set__:
357
+ # and model_fields_set contains the field
358
+ if self.cm_mass_power_out is None and "cm_mass_power_out" in self.model_fields_set:
388
359
  _dict['cmMassPowerOut'] = None
389
360
 
390
- # set to None if p_requested (nullable) is None
391
- # and __fields_set__ contains the field
392
- if self.p_requested is None and "p_requested" in self.__fields_set__:
393
- _dict['pRequested'] = None
394
-
395
- # set to None if power_error_integral (nullable) is None
396
- # and __fields_set__ contains the field
397
- if self.power_error_integral is None and "power_error_integral" in self.__fields_set__:
398
- _dict['powerErrorIntegral'] = None
361
+ # set to None if temperature_error_integral (nullable) is None
362
+ # and model_fields_set contains the field
363
+ if self.temperature_error_integral is None and "temperature_error_integral" in self.model_fields_set:
364
+ _dict['temperatureErrorIntegral'] = None
399
365
 
400
366
  # set to None if thermostat_status (nullable) is None
401
- # and __fields_set__ contains the field
402
- if self.thermostat_status is None and "thermostat_status" in self.__fields_set__:
367
+ # and model_fields_set contains the field
368
+ if self.thermostat_status is None and "thermostat_status" in self.model_fields_set:
403
369
  _dict['thermostatStatus'] = None
404
370
 
405
371
  # set to None if t_room (nullable) is None
406
- # and __fields_set__ contains the field
407
- if self.t_room is None and "t_room" in self.__fields_set__:
372
+ # and model_fields_set contains the field
373
+ if self.t_room is None and "t_room" in self.model_fields_set:
408
374
  _dict['tRoom'] = None
409
375
 
410
376
  # set to None if t_room_target (nullable) is None
411
- # and __fields_set__ contains the field
412
- if self.t_room_target is None and "t_room_target" in self.__fields_set__:
377
+ # and model_fields_set contains the field
378
+ if self.t_room_target is None and "t_room_target" in self.model_fields_set:
413
379
  _dict['tRoomTarget'] = None
414
380
 
415
381
  # set to None if ot_boiler_status (nullable) is None
416
- # and __fields_set__ contains the field
417
- if self.ot_boiler_status is None and "ot_boiler_status" in self.__fields_set__:
382
+ # and model_fields_set contains the field
383
+ if self.ot_boiler_status is None and "ot_boiler_status" in self.model_fields_set:
418
384
  _dict['otBoilerStatus'] = None
419
385
 
420
386
  # set to None if ot_boiler_feed_temperature (nullable) is None
421
- # and __fields_set__ contains the field
422
- if self.ot_boiler_feed_temperature is None and "ot_boiler_feed_temperature" in self.__fields_set__:
387
+ # and model_fields_set contains the field
388
+ if self.ot_boiler_feed_temperature is None and "ot_boiler_feed_temperature" in self.model_fields_set:
423
389
  _dict['otBoilerFeedTemperature'] = None
424
390
 
425
391
  # set to None if ot_boiler_return_temperature (nullable) is None
426
- # and __fields_set__ contains the field
427
- if self.ot_boiler_return_temperature is None and "ot_boiler_return_temperature" in self.__fields_set__:
392
+ # and model_fields_set contains the field
393
+ if self.ot_boiler_return_temperature is None and "ot_boiler_return_temperature" in self.model_fields_set:
428
394
  _dict['otBoilerReturnTemperature'] = None
429
395
 
396
+ # set to None if inverter_input_voltage (nullable) is None
397
+ # and model_fields_set contains the field
398
+ if self.inverter_input_voltage is None and "inverter_input_voltage" in self.model_fields_set:
399
+ _dict['inverterInputVoltage'] = None
400
+
401
+ # set to None if central_heating_pwm_requested_duty_cycle (nullable) is None
402
+ # and model_fields_set contains the field
403
+ if self.central_heating_pwm_requested_duty_cycle is None and "central_heating_pwm_requested_duty_cycle" in self.model_fields_set:
404
+ _dict['centralHeatingPwmRequestedDutyCycle'] = None
405
+
406
+ # set to None if central_heating_flow (nullable) is None
407
+ # and model_fields_set contains the field
408
+ if self.central_heating_flow is None and "central_heating_flow" in self.model_fields_set:
409
+ _dict['centralHeatingFlow'] = None
410
+
411
+ # set to None if dhw_pwm_requested_duty_cycle (nullable) is None
412
+ # and model_fields_set contains the field
413
+ if self.dhw_pwm_requested_duty_cycle is None and "dhw_pwm_requested_duty_cycle" in self.model_fields_set:
414
+ _dict['dhwPwmRequestedDutyCycle'] = None
415
+
416
+ # set to None if dhw_flow (nullable) is None
417
+ # and model_fields_set contains the field
418
+ if self.dhw_flow is None and "dhw_flow" in self.model_fields_set:
419
+ _dict['dhwFlow'] = None
420
+
421
+ # set to None if indoor_unit_heater_temperature (nullable) is None
422
+ # and model_fields_set contains the field
423
+ if self.indoor_unit_heater_temperature is None and "indoor_unit_heater_temperature" in self.model_fields_set:
424
+ _dict['indoorUnitHeaterTemperature'] = None
425
+
426
+ # set to None if indoor_unit_input_current (nullable) is None
427
+ # and model_fields_set contains the field
428
+ if self.indoor_unit_input_current is None and "indoor_unit_input_current" in self.model_fields_set:
429
+ _dict['indoorUnitInputCurrent'] = None
430
+
431
+ # set to None if sinr (nullable) is None
432
+ # and model_fields_set contains the field
433
+ if self.sinr is None and "sinr" in self.model_fields_set:
434
+ _dict['sinr'] = None
435
+
436
+ # set to None if cooling_status (nullable) is None
437
+ # and model_fields_set contains the field
438
+ if self.cooling_status is None and "cooling_status" in self.model_fields_set:
439
+ _dict['coolingStatus'] = None
440
+
441
+ # set to None if debug_variable1 (nullable) is None
442
+ # and model_fields_set contains the field
443
+ if self.debug_variable1 is None and "debug_variable1" in self.model_fields_set:
444
+ _dict['debugVariable1'] = None
445
+
446
+ # set to None if debug_variable2 (nullable) is None
447
+ # and model_fields_set contains the field
448
+ if self.debug_variable2 is None and "debug_variable2" in self.model_fields_set:
449
+ _dict['debugVariable2'] = None
450
+
451
+ # set to None if debug_variable3 (nullable) is None
452
+ # and model_fields_set contains the field
453
+ if self.debug_variable3 is None and "debug_variable3" in self.model_fields_set:
454
+ _dict['debugVariable3'] = None
455
+
456
+ # set to None if debug_variable4 (nullable) is None
457
+ # and model_fields_set contains the field
458
+ if self.debug_variable4 is None and "debug_variable4" in self.model_fields_set:
459
+ _dict['debugVariable4'] = None
460
+
461
+ # set to None if debug_variable5 (nullable) is None
462
+ # and model_fields_set contains the field
463
+ if self.debug_variable5 is None and "debug_variable5" in self.model_fields_set:
464
+ _dict['debugVariable5'] = None
465
+
430
466
  return _dict
431
467
 
432
468
  @classmethod
433
- def from_dict(cls, obj: dict) -> RawHeatPumpLogDto:
469
+ def from_dict(cls, obj: Dict) -> Self:
434
470
  """Create an instance of RawHeatPumpLogDto from a dict"""
435
471
  if obj is None:
436
472
  return None
437
473
 
438
474
  if not isinstance(obj, dict):
439
- return RawHeatPumpLogDto.parse_obj(obj)
475
+ return cls.model_validate(obj)
440
476
 
441
- _obj = RawHeatPumpLogDto.parse_obj({
442
- "heat_pump_id": obj.get("heatPumpId"),
477
+ _obj = cls.model_validate({
478
+ "heatPumpId": obj.get("heatPumpId"),
443
479
  "timestamp": obj.get("timestamp"),
444
- "firmware_revision": obj.get("firmwareRevision"),
445
- "packet_counter": obj.get("packetCounter"),
446
- "unix_time_mcu": obj.get("unixTimeMcu"),
447
480
  "state": obj.get("state"),
448
- "rpm_ctrl": obj.get("rpmCtrl"),
481
+ "rpmCtrl": obj.get("rpmCtrl"),
449
482
  "error": obj.get("error"),
450
- "error_decoded_dtc_none": obj.get("errorDecodedDtcNone"),
451
- "error_decoded_dtc_continue": obj.get("errorDecodedDtcContinue"),
452
- "error_decoded_dtc_compressor_off": obj.get("errorDecodedDtcCompressorOff"),
453
- "error_decoded_dtc_defrost_forbidden": obj.get("errorDecodedDtcDefrostForbidden"),
454
- "error_decoded_dtc_request_service": obj.get("errorDecodedDtcRequestService"),
455
- "error_decoded_dtc_use_heating_curve": obj.get("errorDecodedDtcUseHeatingCurve"),
456
- "error_decoded_dtc_dhw_forbidden": obj.get("errorDecodedDtcDhwForbidden"),
457
- "error_decoded_dtc_error": obj.get("errorDecodedDtcError"),
458
- "error_decoded_dtc_inactive": obj.get("errorDecodedDtcInactive"),
459
- "heatsink": obj.get("heatsink"),
460
- "si5": obj.get("si5"),
461
- "e80": obj.get("e80"),
462
- "e81": obj.get("e81"),
463
- "e84": obj.get("e84"),
464
- "e85": obj.get("e85"),
465
- "control_bridge_status": obj.get("controlBridgeStatus"),
466
- "control_bridge_status_decoded_water_pump": obj.get("controlBridgeStatusDecodedWaterPump"),
467
- "control_bridge_status_decoded_dhw_valve": obj.get("controlBridgeStatusDecodedDhwValve"),
468
- "control_bridge_status_decoded_gas_boiler": obj.get("controlBridgeStatusDecodedGasBoiler"),
469
- "control_bridge_status_decoded_electric_heater": obj.get("controlBridgeStatusDecodedElectricHeater"),
470
- "control_bridge_status_decoded_water_pump2": obj.get("controlBridgeStatusDecodedWaterPump2"),
471
- "input_status": obj.get("inputStatus"),
472
- "current_control_method": obj.get("currentControlMethod"),
473
- "signal_strength": obj.get("signalStrength"),
483
+ "errorDecodedDtcNone": obj.get("errorDecodedDtcNone"),
484
+ "errorDecodedDtcContinue": obj.get("errorDecodedDtcContinue"),
485
+ "errorDecodedDtcCompressorOff": obj.get("errorDecodedDtcCompressorOff"),
486
+ "errorDecodedDtcDefrostForbidden": obj.get("errorDecodedDtcDefrostForbidden"),
487
+ "errorDecodedDtcRequestService": obj.get("errorDecodedDtcRequestService"),
488
+ "errorDecodedDtcUseHeatingCurve": obj.get("errorDecodedDtcUseHeatingCurve"),
489
+ "errorDecodedDtcDhwForbidden": obj.get("errorDecodedDtcDhwForbidden"),
490
+ "errorDecodedDtcError": obj.get("errorDecodedDtcError"),
491
+ "errorDecodedDtcInactive": obj.get("errorDecodedDtcInactive"),
492
+ "controlBridgeStatus": obj.get("controlBridgeStatus"),
493
+ "controlBridgeStatusDecodedWaterPump": obj.get("controlBridgeStatusDecodedWaterPump"),
494
+ "controlBridgeStatusDecodedDhwValve": obj.get("controlBridgeStatusDecodedDhwValve"),
495
+ "controlBridgeStatusDecodedGasBoiler": obj.get("controlBridgeStatusDecodedGasBoiler"),
496
+ "controlBridgeStatusDecodedElectricHeater": obj.get("controlBridgeStatusDecodedElectricHeater"),
497
+ "controlBridgeStatusDecodedWaterPump2": obj.get("controlBridgeStatusDecodedWaterPump2"),
498
+ "inputStatus": obj.get("inputStatus"),
499
+ "currentControlMethod": obj.get("currentControlMethod"),
500
+ "signalStrength": obj.get("signalStrength"),
474
501
  "t1": obj.get("t1"),
475
502
  "t2": obj.get("t2"),
476
- "t_spare_ntc": obj.get("tSpareNtc"),
477
- "t_board": obj.get("tBoard"),
478
- "t_air_in": obj.get("tAirIn"),
479
- "t_air_out": obj.get("tAirOut"),
480
- "t_water_in": obj.get("tWaterIn"),
481
- "t_water_out": obj.get("tWaterOut"),
482
- "t_water_house_in": obj.get("tWaterHouseIn"),
503
+ "tSpareNtc": obj.get("tSpareNtc"),
504
+ "tBoard": obj.get("tBoard"),
505
+ "tAirIn": obj.get("tAirIn"),
506
+ "tAirOut": obj.get("tAirOut"),
507
+ "tWaterIn": obj.get("tWaterIn"),
508
+ "tWaterOut": obj.get("tWaterOut"),
509
+ "tWaterHouseIn": obj.get("tWaterHouseIn"),
483
510
  "rpm": obj.get("rpm"),
484
- "rpm_limiter": obj.get("rpmLimiter"),
485
- "rpm_limiter_type": obj.get("rpmLimiterType"),
486
- "p_compressor_in": obj.get("pCompressorIn"),
487
- "p_compressor_out": obj.get("pCompressorOut"),
488
- "p_compressor_in_target": obj.get("pCompressorInTarget"),
489
- "t_inverter": obj.get("tInverter"),
490
- "t_compressor_in": obj.get("tCompressorIn"),
491
- "t_compressor_out": obj.get("tCompressorOut"),
492
- "t_compressor_in_transient": obj.get("tCompressorInTransient"),
493
- "t_compressor_out_transient": obj.get("tCompressorOutTransient"),
494
- "delta_t_compressor_in_superheat": obj.get("deltaTCompressorInSuperheat"),
495
- "compressor_power_low_accuracy": obj.get("compressorPowerLowAccuracy"),
511
+ "rpmLimiter": obj.get("rpmLimiter"),
512
+ "rpmLimiterType": obj.get("rpmLimiterType"),
513
+ "pCompressorIn": obj.get("pCompressorIn"),
514
+ "pCompressorOut": obj.get("pCompressorOut"),
515
+ "pCompressorInTarget": obj.get("pCompressorInTarget"),
516
+ "tInverter": obj.get("tInverter"),
517
+ "tCompressorIn": obj.get("tCompressorIn"),
518
+ "tCompressorOut": obj.get("tCompressorOut"),
519
+ "tCompressorInTransient": obj.get("tCompressorInTransient"),
520
+ "tCompressorOutTransient": obj.get("tCompressorOutTransient"),
521
+ "deltaTCompressorInSuperheat": obj.get("deltaTCompressorInSuperheat"),
522
+ "compressorPowerLowAccuracy": obj.get("compressorPowerLowAccuracy"),
496
523
  "fan": obj.get("fan"),
497
- "fan_power": obj.get("fanPower"),
524
+ "fanPower": obj.get("fanPower"),
498
525
  "valve": obj.get("valve"),
499
- "exv_flow_step_gain": obj.get("exvFlowStepGain"),
500
- "cm_mass_flow": obj.get("cmMassFlow"),
501
- "cm_mass_power_in": obj.get("cmMassPowerIn"),
502
- "cm_mass_power_out": obj.get("cmMassPowerOut"),
503
- "p_requested": obj.get("pRequested"),
504
- "power_error_integral": obj.get("powerErrorIntegral"),
505
- "on_off_thermostat_state": obj.get("onOffThermostatState"),
506
- "thermostat_status": obj.get("thermostatStatus"),
507
- "t_room": obj.get("tRoom"),
508
- "t_room_target": obj.get("tRoomTarget"),
509
- "t_thermostat_setpoint": obj.get("tThermostatSetpoint"),
510
- "ot_boiler_status": obj.get("otBoilerStatus"),
511
- "ot_boiler_feed_temperature": obj.get("otBoilerFeedTemperature"),
512
- "ot_boiler_return_temperature": obj.get("otBoilerReturnTemperature"),
526
+ "cmMassPowerIn": obj.get("cmMassPowerIn"),
527
+ "cmMassPowerOut": obj.get("cmMassPowerOut"),
528
+ "temperatureErrorIntegral": obj.get("temperatureErrorIntegral"),
529
+ "onOffThermostatState": obj.get("onOffThermostatState"),
530
+ "thermostatStatus": obj.get("thermostatStatus"),
531
+ "tRoom": obj.get("tRoom"),
532
+ "tRoomTarget": obj.get("tRoomTarget"),
533
+ "tThermostatSetpoint": obj.get("tThermostatSetpoint"),
534
+ "otBoilerStatus": obj.get("otBoilerStatus"),
535
+ "otBoilerFeedTemperature": obj.get("otBoilerFeedTemperature"),
536
+ "otBoilerReturnTemperature": obj.get("otBoilerReturnTemperature"),
537
+ "inverterInputVoltage": obj.get("inverterInputVoltage"),
538
+ "centralHeatingPwmRequestedDutyCycle": obj.get("centralHeatingPwmRequestedDutyCycle"),
539
+ "centralHeatingFlow": obj.get("centralHeatingFlow"),
540
+ "dhwPwmRequestedDutyCycle": obj.get("dhwPwmRequestedDutyCycle"),
541
+ "dhwFlow": obj.get("dhwFlow"),
542
+ "indoorUnitHeaterTemperature": obj.get("indoorUnitHeaterTemperature"),
543
+ "indoorUnitInputCurrent": obj.get("indoorUnitInputCurrent"),
544
+ "sinr": obj.get("sinr"),
545
+ "coolingStatus": obj.get("coolingStatus"),
546
+ "debugVariable1": obj.get("debugVariable1"),
547
+ "debugVariable2": obj.get("debugVariable2"),
548
+ "debugVariable3": obj.get("debugVariable3"),
549
+ "debugVariable4": obj.get("debugVariable4"),
550
+ "debugVariable5": obj.get("debugVariable5"),
513
551
  "interval": obj.get("interval")
514
552
  })
515
553
  return _obj