|
21 | 21 | LuxOperationMode, |
22 | 22 | LuxParameter as LP, |
23 | 23 | LuxStatus1Option, |
| 24 | + LuxStatus3Option, |
24 | 25 | LuxVisibility as LV, |
25 | 26 | ) |
26 | 27 | from .model import LuxtronikCoordinatorData |
@@ -99,11 +100,32 @@ def correct_key_value( |
99 | 100 | if ( |
100 | 101 | sensor_id == LC.C0080_STATUS |
101 | 102 | and value == LuxOperationMode.no_request |
102 | | - and bool(get_sensor_data(sensors, LC.C0119_STATUS_LINE_3) == "cooling") |
| 103 | + and bool(get_sensor_data(sensors, LC.C0119_STATUS_LINE_3) == LuxStatus3Option.cooling.value) |
103 | 104 | ): |
104 | 105 | return LuxOperationMode.cooling |
105 | 106 | # endregion Workaround Detect passive cooling operation mode |
106 | | - |
| 107 | + # region Workaround Detect active cooling operation mode |
| 108 | + if ( |
| 109 | + sensor_id == LC.C0080_STATUS |
| 110 | + and value == LuxOperationMode.no_request |
| 111 | + and bool(get_sensor_data(sensors, LC.C0119_STATUS_LINE_3) in LuxStatus3Option.heating.value) |
| 112 | + ): |
| 113 | + T_in = get_sensor_data(sensors, LC.C0010_FLOW_IN_TEMPERATURE) |
| 114 | + T_out = get_sensor_data(sensors, LC.C0011_FLOW_OUT_TEMPERATURE) |
| 115 | + T_heat_in = get_sensor_data(sensors, LC.C0204_HEAT_SOURCE_INPUT_TEMPERATURE) |
| 116 | + T_heat_out = get_sensor_data(sensors, LC.C0024_HEAT_SOURCE_OUTPUT_TEMPERATURE) |
| 117 | + Flow_WQ = get_sensor_data(sensors, LC.C0173_HEAT_SOURCE_FLOW_RATE) |
| 118 | + Pump = get_sensor_data(sensors, LC.C0043_PUMP_FLOW) |
| 119 | + if ( |
| 120 | + (T_out > T_in) |
| 121 | + and (T_heat_out > T_heat_in) |
| 122 | + and (Flow_WQ > 0) |
| 123 | + and Pump |
| 124 | + ): |
| 125 | + return LuxOperationMode.cooling |
| 126 | + # endregion Workaround Detect active cooling operation mode |
| 127 | + |
| 128 | + # no changes needed, return sensor value |
107 | 129 | return value |
108 | 130 |
|
109 | 131 |
|
|
0 commit comments