Alter detection logic of heater and aircon device.
This commit is contained in:
parent
1e452c1a12
commit
a0b8b5a44e
@ -141,16 +141,21 @@ enum class ClockSource : u_int8_t {
|
||||
|
||||
enum class TRUMA_DEVICE : u_int8_t {
|
||||
UNKNOWN = 0x00,
|
||||
|
||||
// Saphir Compact AC
|
||||
AIRCON_DEVICE = 0x01,
|
||||
// Combi 4
|
||||
HEATER_COMBI4 = 0x02,
|
||||
// Vario Heat Comfort (non E)
|
||||
HEATER_VARIO = 0x03,
|
||||
|
||||
// CP Plus for Combi
|
||||
CPPLUS_COMBI = 0x04,
|
||||
// CP Plus for Vario Heat
|
||||
CPPLUS_VARIO = 0x05,
|
||||
|
||||
// Combi 4
|
||||
HEATER_COMBI4 = 0x02,
|
||||
// Vario Heat Comfort (non E)
|
||||
HEATER_VARIO = 0x03,
|
||||
// Old Truma CP6 (MY 2015)
|
||||
HEATER_CP6 = 0x05,
|
||||
// Combi 6 D
|
||||
HEATER_COMBI6D = 0x06,
|
||||
};
|
||||
|
||||
@ -334,17 +334,19 @@ const u_int8_t *TrumaiNetBoxApp::lin_multiframe_recieved(const u_int8_t *message
|
||||
ESP_LOGW(TAG, "Unknown information in StatusFrameDevice found. Please report.");
|
||||
}
|
||||
|
||||
if (truma_device == TRUMA_DEVICE::HEATER_COMBI4) {
|
||||
this->heater_device_ = TRUMA_DEVICE::HEATER_COMBI4;
|
||||
} else if (truma_device == TRUMA_DEVICE::HEATER_COMBI6D) {
|
||||
this->heater_device_ = TRUMA_DEVICE::HEATER_COMBI6D;
|
||||
} else if (truma_device == TRUMA_DEVICE::HEATER_VARIO) {
|
||||
this->heater_device_ = TRUMA_DEVICE::HEATER_VARIO;
|
||||
}
|
||||
// first submitted device is CP Plus device
|
||||
const auto is_CPPLUSDevice = device.device_id == 0;
|
||||
|
||||
if (truma_device == TRUMA_DEVICE::AIRCON_DEVICE) {
|
||||
if (!is_CPPLUSDevice) {
|
||||
// Assumption first device is Heater
|
||||
if (device.device_id == 1) {
|
||||
this->heater_device_ = truma_device;
|
||||
}
|
||||
// Assumption second device is Aircon
|
||||
if (device.device_id == 2) {
|
||||
this->aircon_device_ = TRUMA_DEVICE::AIRCON_DEVICE;
|
||||
}
|
||||
}
|
||||
|
||||
if (device.device_count == 2 && this->heater_device_ != TRUMA_DEVICE::UNKNOWN) {
|
||||
// Assumption 2 devices mean CP Plus and Heater.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user