# coding: utf-8

"""
    Weheat Backend

    This is the backend for the Weheat project

    The version of the OpenAPI document: v1
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import pprint
import re  # noqa: F401
import json

from datetime import datetime
from typing import Optional, Union
from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr

class RawHeatPumpLogDto(BaseModel):
    """
    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
    """
    heat_pump_id: StrictStr = Field(..., alias="heatPumpId", description="Identifier of the Heat Pump")
    timestamp: datetime = Field(..., description="Timestamp of when this was logged to the server")
    firmware_revision: Optional[StrictInt] = Field(None, alias="firmwareRevision", description="Version of heat pump logs (should be 1026)")
    packet_counter: Optional[StrictInt] = Field(None, alias="packetCounter", description="Packet counter of inside the control board")
    unix_time_mcu: Optional[StrictInt] = Field(None, alias="unixTimeMcu", description="Unix time inside the control board at the time it send this log")
    state: Optional[StrictInt] = Field(None, description="Current heat pump state (which is decoded in the view)")
    rpm_ctrl: Optional[StrictInt] = Field(None, alias="rpmCtrl", description="Current mode of RPM control (which is decoded in the view)")
    error: Optional[StrictInt] = Field(None, description="Current state of error in the heat pump (which is decoded in the view)")
    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)")
    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)")
    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)")
    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)")
    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)")
    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)")
    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)")
    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)")
    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)")
    heatsink: Optional[StrictInt] = Field(None, description="Raw state of the where the heat pump is dumping it's heat")
    si5: Optional[StrictInt] = Field(None, description="Raw state of the heat pump")
    e80: Optional[StrictInt] = Field(None, description="Raw error code state 80 of the heat pump")
    e81: Optional[StrictInt] = Field(None, description="Raw error code state 81 of the heat pump")
    e84: Optional[StrictInt] = Field(None, description="Raw error code state 84 of the heat pump")
    e85: Optional[StrictInt] = Field(None, description="Raw error code state 85 of the heat pump")
    control_bridge_status: Optional[StrictInt] = Field(None, alias="controlBridgeStatus", description="Raw control bridge status of the heat pump (bitwise encoded)")
    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)")
    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)")
    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)")
    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)")
    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)")
    input_status: Optional[StrictInt] = Field(None, alias="inputStatus", description="Raw input status of the heat pump")
    current_control_method: Optional[StrictInt] = Field(None, alias="currentControlMethod", description="Raw current control method state of the heat pump")
    signal_strength: Optional[StrictInt] = Field(None, alias="signalStrength", description="Signal strength (rssi) reported by the modem of the control board")
    t1: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="Temperature T1 (TOP) of the DHW sensors")
    t2: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="Temperature T2 (BOTTOM) of the DHW sensors")
    t_spare_ntc: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tSpareNtc", description="Spare temperature sensor (for DHW)")
    t_board: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tBoard", description="Temperature of the control board")
    t_air_in: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tAirIn", description="Temperature of the air going into the heat pump")
    t_air_out: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tAirOut", description="Temperature of the air going out of the heat pump")
    t_water_in: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tWaterIn", description="Temperature of the water going into the heat pump")
    t_water_out: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tWaterOut", description="Temperature of the water going out of the heat pump")
    t_water_house_in: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tWaterHouseIn", description="Temperature of the water going into the building")
    rpm: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="Rpm of the compressor")
    rpm_limiter: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="rpmLimiter", description="Rpm limit of the compressor")
    rpm_limiter_type: Optional[StrictInt] = Field(None, alias="rpmLimiterType", description="Type of why the rpm is limited")
    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")
    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")
    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")
    t_inverter: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tInverter", description="Temperature of the inverter")
    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")
    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")
    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")
    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")
    delta_t_compressor_in_superheat: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="deltaTCompressorInSuperheat", description="Difference in temperature for superheat based on the compressor temperatures")
    compressor_power_low_accuracy: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="compressorPowerLowAccuracy", description="Power used by the compressor (low accuracy)")
    fan: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="State of the fan")
    fan_power: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="fanPower", description="Power used by the fan")
    valve: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="Position value of the valve")
    exv_flow_step_gain: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="exvFlowStepGain")
    cm_mass_flow: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="cmMassFlow", description="Flow of the water going through the heat pump")
    cm_mass_power_in: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="cmMassPowerIn", description="Power going into the heat pump")
    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)")
    p_requested: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="pRequested", description="Power requested by the heat pump")
    power_error_integral: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="powerErrorIntegral", description="Current value of the power error integral")
    on_off_thermostat_state: Optional[StrictInt] = Field(None, alias="onOffThermostatState", description="State of the on/off thermostat")
    thermostat_status: Optional[StrictInt] = Field(None, alias="thermostatStatus", description="Status of the OpenTherm thermostat")
    t_room: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tRoom", description="Temperature of the room given by the OpenTherm thermostat")
    t_room_target: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="tRoomTarget", description="Target temperature of the room given by the OpenTherm thermostat")
    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")
    ot_boiler_status: Optional[StrictInt] = Field(None, alias="otBoilerStatus", description="Status of the OpenTherm boiler")
    ot_boiler_feed_temperature: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="otBoilerFeedTemperature", description="Feed temperature of the OpenTherm boiler")
    ot_boiler_return_temperature: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="otBoilerReturnTemperature", description="Return temperature of the OpenTherm boiler")
    interval: StrictInt = Field(..., description="Interval for this log in seconds")
    __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"]

    class Config:
        """Pydantic configuration"""
        allow_population_by_field_name = True
        validate_assignment = True

    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.dict(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> RawHeatPumpLogDto:
        """Create an instance of RawHeatPumpLogDto from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self):
        """Returns the dictionary representation of the model using alias"""
        _dict = self.dict(by_alias=True,
                          exclude={
                          },
                          exclude_none=True)
        # set to None if firmware_revision (nullable) is None
        # and __fields_set__ contains the field
        if self.firmware_revision is None and "firmware_revision" in self.__fields_set__:
            _dict['firmwareRevision'] = None

        # set to None if packet_counter (nullable) is None
        # and __fields_set__ contains the field
        if self.packet_counter is None and "packet_counter" in self.__fields_set__:
            _dict['packetCounter'] = None

        # set to None if unix_time_mcu (nullable) is None
        # and __fields_set__ contains the field
        if self.unix_time_mcu is None and "unix_time_mcu" in self.__fields_set__:
            _dict['unixTimeMcu'] = None

        # set to None if error (nullable) is None
        # and __fields_set__ contains the field
        if self.error is None and "error" in self.__fields_set__:
            _dict['error'] = None

        # set to None if error_decoded_dtc_none (nullable) is None
        # and __fields_set__ contains the field
        if self.error_decoded_dtc_none is None and "error_decoded_dtc_none" in self.__fields_set__:
            _dict['errorDecodedDtcNone'] = None

        # set to None if error_decoded_dtc_continue (nullable) is None
        # and __fields_set__ contains the field
        if self.error_decoded_dtc_continue is None and "error_decoded_dtc_continue" in self.__fields_set__:
            _dict['errorDecodedDtcContinue'] = None

        # set to None if error_decoded_dtc_compressor_off (nullable) is None
        # and __fields_set__ contains the field
        if self.error_decoded_dtc_compressor_off is None and "error_decoded_dtc_compressor_off" in self.__fields_set__:
            _dict['errorDecodedDtcCompressorOff'] = None

        # set to None if error_decoded_dtc_defrost_forbidden (nullable) is None
        # and __fields_set__ contains the field
        if self.error_decoded_dtc_defrost_forbidden is None and "error_decoded_dtc_defrost_forbidden" in self.__fields_set__:
            _dict['errorDecodedDtcDefrostForbidden'] = None

        # set to None if error_decoded_dtc_request_service (nullable) is None
        # and __fields_set__ contains the field
        if self.error_decoded_dtc_request_service is None and "error_decoded_dtc_request_service" in self.__fields_set__:
            _dict['errorDecodedDtcRequestService'] = None

        # set to None if error_decoded_dtc_use_heating_curve (nullable) is None
        # and __fields_set__ contains the field
        if self.error_decoded_dtc_use_heating_curve is None and "error_decoded_dtc_use_heating_curve" in self.__fields_set__:
            _dict['errorDecodedDtcUseHeatingCurve'] = None

        # set to None if error_decoded_dtc_dhw_forbidden (nullable) is None
        # and __fields_set__ contains the field
        if self.error_decoded_dtc_dhw_forbidden is None and "error_decoded_dtc_dhw_forbidden" in self.__fields_set__:
            _dict['errorDecodedDtcDhwForbidden'] = None

        # set to None if error_decoded_dtc_error (nullable) is None
        # and __fields_set__ contains the field
        if self.error_decoded_dtc_error is None and "error_decoded_dtc_error" in self.__fields_set__:
            _dict['errorDecodedDtcError'] = None

        # set to None if error_decoded_dtc_inactive (nullable) is None
        # and __fields_set__ contains the field
        if self.error_decoded_dtc_inactive is None and "error_decoded_dtc_inactive" in self.__fields_set__:
            _dict['errorDecodedDtcInactive'] = None

        # set to None if heatsink (nullable) is None
        # and __fields_set__ contains the field
        if self.heatsink is None and "heatsink" in self.__fields_set__:
            _dict['heatsink'] = None

        # set to None if si5 (nullable) is None
        # and __fields_set__ contains the field
        if self.si5 is None and "si5" in self.__fields_set__:
            _dict['si5'] = None

        # set to None if e80 (nullable) is None
        # and __fields_set__ contains the field
        if self.e80 is None and "e80" in self.__fields_set__:
            _dict['e80'] = None

        # set to None if e81 (nullable) is None
        # and __fields_set__ contains the field
        if self.e81 is None and "e81" in self.__fields_set__:
            _dict['e81'] = None

        # set to None if e84 (nullable) is None
        # and __fields_set__ contains the field
        if self.e84 is None and "e84" in self.__fields_set__:
            _dict['e84'] = None

        # set to None if e85 (nullable) is None
        # and __fields_set__ contains the field
        if self.e85 is None and "e85" in self.__fields_set__:
            _dict['e85'] = None

        # set to None if control_bridge_status (nullable) is None
        # and __fields_set__ contains the field
        if self.control_bridge_status is None and "control_bridge_status" in self.__fields_set__:
            _dict['controlBridgeStatus'] = None

        # set to None if control_bridge_status_decoded_water_pump (nullable) is None
        # and __fields_set__ contains the field
        if self.control_bridge_status_decoded_water_pump is None and "control_bridge_status_decoded_water_pump" in self.__fields_set__:
            _dict['controlBridgeStatusDecodedWaterPump'] = None

        # set to None if control_bridge_status_decoded_dhw_valve (nullable) is None
        # and __fields_set__ contains the field
        if self.control_bridge_status_decoded_dhw_valve is None and "control_bridge_status_decoded_dhw_valve" in self.__fields_set__:
            _dict['controlBridgeStatusDecodedDhwValve'] = None

        # set to None if control_bridge_status_decoded_gas_boiler (nullable) is None
        # and __fields_set__ contains the field
        if self.control_bridge_status_decoded_gas_boiler is None and "control_bridge_status_decoded_gas_boiler" in self.__fields_set__:
            _dict['controlBridgeStatusDecodedGasBoiler'] = None

        # set to None if control_bridge_status_decoded_electric_heater (nullable) is None
        # and __fields_set__ contains the field
        if self.control_bridge_status_decoded_electric_heater is None and "control_bridge_status_decoded_electric_heater" in self.__fields_set__:
            _dict['controlBridgeStatusDecodedElectricHeater'] = None

        # set to None if control_bridge_status_decoded_water_pump2 (nullable) is None
        # and __fields_set__ contains the field
        if self.control_bridge_status_decoded_water_pump2 is None and "control_bridge_status_decoded_water_pump2" in self.__fields_set__:
            _dict['controlBridgeStatusDecodedWaterPump2'] = None

        # set to None if input_status (nullable) is None
        # and __fields_set__ contains the field
        if self.input_status is None and "input_status" in self.__fields_set__:
            _dict['inputStatus'] = None

        # set to None if current_control_method (nullable) is None
        # and __fields_set__ contains the field
        if self.current_control_method is None and "current_control_method" in self.__fields_set__:
            _dict['currentControlMethod'] = None

        # set to None if signal_strength (nullable) is None
        # and __fields_set__ contains the field
        if self.signal_strength is None and "signal_strength" in self.__fields_set__:
            _dict['signalStrength'] = None

        # set to None if t1 (nullable) is None
        # and __fields_set__ contains the field
        if self.t1 is None and "t1" in self.__fields_set__:
            _dict['t1'] = None

        # set to None if t2 (nullable) is None
        # and __fields_set__ contains the field
        if self.t2 is None and "t2" in self.__fields_set__:
            _dict['t2'] = None

        # set to None if t_spare_ntc (nullable) is None
        # and __fields_set__ contains the field
        if self.t_spare_ntc is None and "t_spare_ntc" in self.__fields_set__:
            _dict['tSpareNtc'] = None

        # set to None if t_board (nullable) is None
        # and __fields_set__ contains the field
        if self.t_board is None and "t_board" in self.__fields_set__:
            _dict['tBoard'] = None

        # set to None if rpm (nullable) is None
        # and __fields_set__ contains the field
        if self.rpm is None and "rpm" in self.__fields_set__:
            _dict['rpm'] = None

        # set to None if rpm_limiter (nullable) is None
        # and __fields_set__ contains the field
        if self.rpm_limiter is None and "rpm_limiter" in self.__fields_set__:
            _dict['rpmLimiter'] = None

        # set to None if rpm_limiter_type (nullable) is None
        # and __fields_set__ contains the field
        if self.rpm_limiter_type is None and "rpm_limiter_type" in self.__fields_set__:
            _dict['rpmLimiterType'] = None

        # set to None if p_compressor_in (nullable) is None
        # and __fields_set__ contains the field
        if self.p_compressor_in is None and "p_compressor_in" in self.__fields_set__:
            _dict['pCompressorIn'] = None

        # set to None if p_compressor_out (nullable) is None
        # and __fields_set__ contains the field
        if self.p_compressor_out is None and "p_compressor_out" in self.__fields_set__:
            _dict['pCompressorOut'] = None

        # set to None if p_compressor_in_target (nullable) is None
        # and __fields_set__ contains the field
        if self.p_compressor_in_target is None and "p_compressor_in_target" in self.__fields_set__:
            _dict['pCompressorInTarget'] = None

        # set to None if t_inverter (nullable) is None
        # and __fields_set__ contains the field
        if self.t_inverter is None and "t_inverter" in self.__fields_set__:
            _dict['tInverter'] = None

        # set to None if t_compressor_in (nullable) is None
        # and __fields_set__ contains the field
        if self.t_compressor_in is None and "t_compressor_in" in self.__fields_set__:
            _dict['tCompressorIn'] = None

        # set to None if t_compressor_out (nullable) is None
        # and __fields_set__ contains the field
        if self.t_compressor_out is None and "t_compressor_out" in self.__fields_set__:
            _dict['tCompressorOut'] = None

        # set to None if t_compressor_in_transient (nullable) is None
        # and __fields_set__ contains the field
        if self.t_compressor_in_transient is None and "t_compressor_in_transient" in self.__fields_set__:
            _dict['tCompressorInTransient'] = None

        # set to None if t_compressor_out_transient (nullable) is None
        # and __fields_set__ contains the field
        if self.t_compressor_out_transient is None and "t_compressor_out_transient" in self.__fields_set__:
            _dict['tCompressorOutTransient'] = None

        # set to None if delta_t_compressor_in_superheat (nullable) is None
        # and __fields_set__ contains the field
        if self.delta_t_compressor_in_superheat is None and "delta_t_compressor_in_superheat" in self.__fields_set__:
            _dict['deltaTCompressorInSuperheat'] = None

        # set to None if compressor_power_low_accuracy (nullable) is None
        # and __fields_set__ contains the field
        if self.compressor_power_low_accuracy is None and "compressor_power_low_accuracy" in self.__fields_set__:
            _dict['compressorPowerLowAccuracy'] = None

        # set to None if fan (nullable) is None
        # and __fields_set__ contains the field
        if self.fan is None and "fan" in self.__fields_set__:
            _dict['fan'] = None

        # set to None if fan_power (nullable) is None
        # and __fields_set__ contains the field
        if self.fan_power is None and "fan_power" in self.__fields_set__:
            _dict['fanPower'] = None

        # set to None if valve (nullable) is None
        # and __fields_set__ contains the field
        if self.valve is None and "valve" in self.__fields_set__:
            _dict['valve'] = None

        # set to None if exv_flow_step_gain (nullable) is None
        # and __fields_set__ contains the field
        if self.exv_flow_step_gain is None and "exv_flow_step_gain" in self.__fields_set__:
            _dict['exvFlowStepGain'] = None

        # set to None if cm_mass_flow (nullable) is None
        # and __fields_set__ contains the field
        if self.cm_mass_flow is None and "cm_mass_flow" in self.__fields_set__:
            _dict['cmMassFlow'] = None

        # set to None if cm_mass_power_in (nullable) is None
        # and __fields_set__ contains the field
        if self.cm_mass_power_in is None and "cm_mass_power_in" in self.__fields_set__:
            _dict['cmMassPowerIn'] = None

        # set to None if cm_mass_power_out (nullable) is None
        # and __fields_set__ contains the field
        if self.cm_mass_power_out is None and "cm_mass_power_out" in self.__fields_set__:
            _dict['cmMassPowerOut'] = None

        # set to None if p_requested (nullable) is None
        # and __fields_set__ contains the field
        if self.p_requested is None and "p_requested" in self.__fields_set__:
            _dict['pRequested'] = None

        # set to None if power_error_integral (nullable) is None
        # and __fields_set__ contains the field
        if self.power_error_integral is None and "power_error_integral" in self.__fields_set__:
            _dict['powerErrorIntegral'] = None

        # set to None if thermostat_status (nullable) is None
        # and __fields_set__ contains the field
        if self.thermostat_status is None and "thermostat_status" in self.__fields_set__:
            _dict['thermostatStatus'] = None

        # set to None if t_room (nullable) is None
        # and __fields_set__ contains the field
        if self.t_room is None and "t_room" in self.__fields_set__:
            _dict['tRoom'] = None

        # set to None if t_room_target (nullable) is None
        # and __fields_set__ contains the field
        if self.t_room_target is None and "t_room_target" in self.__fields_set__:
            _dict['tRoomTarget'] = None

        # set to None if ot_boiler_status (nullable) is None
        # and __fields_set__ contains the field
        if self.ot_boiler_status is None and "ot_boiler_status" in self.__fields_set__:
            _dict['otBoilerStatus'] = None

        # set to None if ot_boiler_feed_temperature (nullable) is None
        # and __fields_set__ contains the field
        if self.ot_boiler_feed_temperature is None and "ot_boiler_feed_temperature" in self.__fields_set__:
            _dict['otBoilerFeedTemperature'] = None

        # set to None if ot_boiler_return_temperature (nullable) is None
        # and __fields_set__ contains the field
        if self.ot_boiler_return_temperature is None and "ot_boiler_return_temperature" in self.__fields_set__:
            _dict['otBoilerReturnTemperature'] = None

        return _dict

    @classmethod
    def from_dict(cls, obj: dict) -> RawHeatPumpLogDto:
        """Create an instance of RawHeatPumpLogDto from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return RawHeatPumpLogDto.parse_obj(obj)

        _obj = RawHeatPumpLogDto.parse_obj({
            "heat_pump_id": obj.get("heatPumpId"),
            "timestamp": obj.get("timestamp"),
            "firmware_revision": obj.get("firmwareRevision"),
            "packet_counter": obj.get("packetCounter"),
            "unix_time_mcu": obj.get("unixTimeMcu"),
            "state": obj.get("state"),
            "rpm_ctrl": obj.get("rpmCtrl"),
            "error": obj.get("error"),
            "error_decoded_dtc_none": obj.get("errorDecodedDtcNone"),
            "error_decoded_dtc_continue": obj.get("errorDecodedDtcContinue"),
            "error_decoded_dtc_compressor_off": obj.get("errorDecodedDtcCompressorOff"),
            "error_decoded_dtc_defrost_forbidden": obj.get("errorDecodedDtcDefrostForbidden"),
            "error_decoded_dtc_request_service": obj.get("errorDecodedDtcRequestService"),
            "error_decoded_dtc_use_heating_curve": obj.get("errorDecodedDtcUseHeatingCurve"),
            "error_decoded_dtc_dhw_forbidden": obj.get("errorDecodedDtcDhwForbidden"),
            "error_decoded_dtc_error": obj.get("errorDecodedDtcError"),
            "error_decoded_dtc_inactive": obj.get("errorDecodedDtcInactive"),
            "heatsink": obj.get("heatsink"),
            "si5": obj.get("si5"),
            "e80": obj.get("e80"),
            "e81": obj.get("e81"),
            "e84": obj.get("e84"),
            "e85": obj.get("e85"),
            "control_bridge_status": obj.get("controlBridgeStatus"),
            "control_bridge_status_decoded_water_pump": obj.get("controlBridgeStatusDecodedWaterPump"),
            "control_bridge_status_decoded_dhw_valve": obj.get("controlBridgeStatusDecodedDhwValve"),
            "control_bridge_status_decoded_gas_boiler": obj.get("controlBridgeStatusDecodedGasBoiler"),
            "control_bridge_status_decoded_electric_heater": obj.get("controlBridgeStatusDecodedElectricHeater"),
            "control_bridge_status_decoded_water_pump2": obj.get("controlBridgeStatusDecodedWaterPump2"),
            "input_status": obj.get("inputStatus"),
            "current_control_method": obj.get("currentControlMethod"),
            "signal_strength": obj.get("signalStrength"),
            "t1": obj.get("t1"),
            "t2": obj.get("t2"),
            "t_spare_ntc": obj.get("tSpareNtc"),
            "t_board": obj.get("tBoard"),
            "t_air_in": obj.get("tAirIn"),
            "t_air_out": obj.get("tAirOut"),
            "t_water_in": obj.get("tWaterIn"),
            "t_water_out": obj.get("tWaterOut"),
            "t_water_house_in": obj.get("tWaterHouseIn"),
            "rpm": obj.get("rpm"),
            "rpm_limiter": obj.get("rpmLimiter"),
            "rpm_limiter_type": obj.get("rpmLimiterType"),
            "p_compressor_in": obj.get("pCompressorIn"),
            "p_compressor_out": obj.get("pCompressorOut"),
            "p_compressor_in_target": obj.get("pCompressorInTarget"),
            "t_inverter": obj.get("tInverter"),
            "t_compressor_in": obj.get("tCompressorIn"),
            "t_compressor_out": obj.get("tCompressorOut"),
            "t_compressor_in_transient": obj.get("tCompressorInTransient"),
            "t_compressor_out_transient": obj.get("tCompressorOutTransient"),
            "delta_t_compressor_in_superheat": obj.get("deltaTCompressorInSuperheat"),
            "compressor_power_low_accuracy": obj.get("compressorPowerLowAccuracy"),
            "fan": obj.get("fan"),
            "fan_power": obj.get("fanPower"),
            "valve": obj.get("valve"),
            "exv_flow_step_gain": obj.get("exvFlowStepGain"),
            "cm_mass_flow": obj.get("cmMassFlow"),
            "cm_mass_power_in": obj.get("cmMassPowerIn"),
            "cm_mass_power_out": obj.get("cmMassPowerOut"),
            "p_requested": obj.get("pRequested"),
            "power_error_integral": obj.get("powerErrorIntegral"),
            "on_off_thermostat_state": obj.get("onOffThermostatState"),
            "thermostat_status": obj.get("thermostatStatus"),
            "t_room": obj.get("tRoom"),
            "t_room_target": obj.get("tRoomTarget"),
            "t_thermostat_setpoint": obj.get("tThermostatSetpoint"),
            "ot_boiler_status": obj.get("otBoilerStatus"),
            "ot_boiler_feed_temperature": obj.get("otBoilerFeedTemperature"),
            "ot_boiler_return_temperature": obj.get("otBoilerReturnTemperature"),
            "interval": obj.get("interval")
        })
        return _obj


