mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
map device type of integrated devices #917
This commit is contained in:
@@ -1019,22 +1019,6 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const
|
||||
device_p->device_type = DeviceType::HEATSOURCE;
|
||||
break;
|
||||
}
|
||||
} else if (device.device_type == DeviceType::HEATSOURCE) {
|
||||
device_p = &device;
|
||||
if (device_id == EMSdevice::EMS_DEVICE_ID_BOILER) { // AHS as only heatsource on id 0x08
|
||||
device_p->device_type = DeviceType::BOILER;
|
||||
}
|
||||
break;
|
||||
} else if (device.device_type == DeviceType::HEATPUMP) { // integrated modules, same product_id
|
||||
device_p = &device;
|
||||
if (device_id == 0x48) {
|
||||
device_p->device_type = DeviceType::GATEWAY;
|
||||
device_p->name = "WiFi module";
|
||||
} else if (device_id == 0x50) {
|
||||
device_p->device_type = DeviceType::CONNECT;
|
||||
device_p->name = "Wireless sensor base";
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
// it's not a boiler, but we have a match
|
||||
device_p = &device;
|
||||
@@ -1055,6 +1039,17 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const
|
||||
auto device_type = device_p->device_type;
|
||||
auto flags = device_p->flags;
|
||||
|
||||
// check for integrated modules with same product id
|
||||
if (device_type == DeviceType::HEATPUMP) {
|
||||
if (device_id == EMSdevice::EMS_DEVICE_ID_MODEM) {
|
||||
device_type = DeviceType::GATEWAY;
|
||||
name = "WiFi module";
|
||||
} else if (device_id == EMSdevice::EMS_DEVICE_ID_RFBASE) {
|
||||
device_type = DeviceType::CONNECT;
|
||||
name = "Wireless sensor base";
|
||||
}
|
||||
}
|
||||
|
||||
// empty reply to version, read a generic device from database
|
||||
if (product_id == 0) {
|
||||
// check for known device IDs
|
||||
|
||||
Reference in New Issue
Block a user