Skip to content

Commit

Permalink
Remove deprecated Danfoss code (#7472)
Browse files Browse the repository at this point in the history
  • Loading branch information
SwoopX authored Dec 27, 2023
1 parent 8d644a5 commit 4e65254
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 454 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ add_library(${PROJECT_NAME} SHARED
device_tick.cpp
de_web_plugin.cpp
de_web_widget.cpp
diagnostics.cpp
discovery.cpp
electrical_measurement.cpp
event.cpp
Expand Down
97 changes: 2 additions & 95 deletions bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1368,48 +1368,6 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)

return sendConfigureReportingRequest(bt, {rq, rq2, rq3, rq4, rq5});
}
else if (modelId == QLatin1String("TRV001") || // Hive TRV
modelId == QLatin1String("eT093WRO")) // POPP smart thermostat
{
rq.dataType = deCONZ::Zcl16BitInt;
rq.attributeId = 0x0000; // local temperature
rq.minInterval = 60;
rq.maxInterval = 3600;
rq.reportableChange16bit = 50;

ConfigureReportingRequest rq2;
rq2.dataType = deCONZ::Zcl8BitUint;
rq2.attributeId = 0x0008; // Pi heating demand
rq2.minInterval = 60;
rq2.maxInterval = 43200;
rq2.reportableChange8bit = 1;

ConfigureReportingRequest rq3;
rq3.dataType = deCONZ::Zcl16BitInt;
rq3.attributeId = 0x0012; // Occupied heating setpoint
rq3.minInterval = 1;
rq3.maxInterval = 43200;
rq3.reportableChange16bit = 1;

ConfigureReportingRequest rq4;
rq4.dataType = deCONZ::Zcl8BitEnum;
rq4.attributeId = 0x4000; // eTRV Open Window detection
rq4.minInterval = 1;
rq4.maxInterval = 43200;
rq4.reportableChange8bit = 0xff;
rq4.manufacturerCode = VENDOR_DANFOSS;

ConfigureReportingRequest rq5;
rq5.dataType = deCONZ::ZclBoolean;
rq5.attributeId = 0x4012; // Mounting mode active
rq5.minInterval = 1;
rq5.maxInterval = 43200;
rq5.reportableChange8bit = 0xff;
rq5.manufacturerCode = VENDOR_DANFOSS;

return sendConfigureReportingRequest(bt, {rq, rq2, rq3}) || // Use OR because of manuf. specific attributes
sendConfigureReportingRequest(bt, {rq4, rq5});
}
else if (sensor && (modelId == QLatin1String("0x8020") || // Danfoss RT24V Display thermostat
modelId == QLatin1String("0x8021") || // Danfoss RT24V Display thermostat with floor sensor
modelId == QLatin1String("0x8030") || // Danfoss RTbattery Display thermostat
Expand Down Expand Up @@ -1598,27 +1556,7 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
}
else if (bt.binding.clusterId == THERMOSTAT_UI_CONFIGURATION_CLUSTER_ID)
{
if (modelId == QLatin1String("TRV001") || // Hive TRV
modelId == QLatin1String("eT093WRO")) // POPP smart thermostat
{
rq.dataType = deCONZ::Zcl8BitEnum;
rq.attributeId = 0x0001; // Keypad Lockout
rq.minInterval = 1;
rq.maxInterval = 43200;
rq.reportableChange8bit = 0xff;

ConfigureReportingRequest rq2;
rq2.dataType = deCONZ::Zcl8BitEnum;
rq2.attributeId = 0x4000; // Viewing Direction
rq2.minInterval = 1;
rq2.maxInterval = 43200;
rq2.reportableChange8bit = 0xff;
rq2.manufacturerCode = VENDOR_DANFOSS;

return sendConfigureReportingRequest(bt, {rq}) || // Use OR because of manuf. specific attributes
sendConfigureReportingRequest(bt, {rq2});
}
else if (modelId == QLatin1String("SORB") || // Stelpro Orleans Fan
if (modelId == QLatin1String("SORB") || // Stelpro Orleans Fan
modelId == QLatin1String("TH1300ZB") || // Sinope thermostat
modelId == QLatin1String("PR412C") || // Owon thermostat
modelId == QLatin1String("iTRV") || // Drayton Wiser Radiator Thermostat
Expand All @@ -1634,20 +1572,6 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
return sendConfigureReportingRequest(bt, {rq});
}
}
else if (bt.binding.clusterId == DIAGNOSTICS_CLUSTER_ID)
{
if (modelId == QLatin1String("TRV001") || // Hive TRV
modelId == QLatin1String("eT093WRO")) // POPP smart thermostat
{
rq.dataType = deCONZ::Zcl16BitBitMap;
rq.attributeId = 0x4000; // SW error code
rq.minInterval = 1;
rq.maxInterval = 43200;
rq.reportableChange16bit = 0xffff;
rq.manufacturerCode = VENDOR_DANFOSS;
return sendConfigureReportingRequest(bt, {rq});
}
}
else if (bt.binding.clusterId == FAN_CONTROL_CLUSTER_ID)
{
if (modelId.startsWith(QLatin1String("3157100"))) // Centralite pearl
Expand Down Expand Up @@ -1713,9 +1637,7 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
rq.maxInterval = 7200; // value used by Hue bridge
rq.reportableChange8bit = 0; // value used by Hue bridge
}
else if (modelId == QLatin1String("eT093WRO") || // POPP smart thermostat
modelId == QLatin1String("TRV001") || // Hive TRV
modelId == QLatin1String("0x8020") || // Danfoss RT24V Display thermostat
else if (modelId == QLatin1String("0x8020") || // Danfoss RT24V Display thermostat
modelId == QLatin1String("0x8021") || // Danfoss RT24V Display thermostat with floor sensor
modelId == QLatin1String("0x8030") || // Danfoss RTbattery Display thermostat
modelId == QLatin1String("0x8031") || // Danfoss RTbattery Display thermostat with infrared
Expand Down Expand Up @@ -2784,7 +2706,6 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
sensor->modelId() == QLatin1String("SLR1b") ||
sensor->modelId() == QLatin1String("SLT2") ||
sensor->modelId() == QLatin1String("SLT3") ||
sensor->modelId() == QLatin1String("TRV001") ||
// Sengled
sensor->modelId().startsWith(QLatin1String("E13-")) ||
sensor->modelId().startsWith(QLatin1String("E1D-")) ||
Expand Down Expand Up @@ -2862,8 +2783,6 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
sensor->modelId() == QLatin1String("0x8031") ||
sensor->modelId() == QLatin1String("0x8034") ||
sensor->modelId() == QLatin1String("0x8035") ||
// POPP
sensor->modelId() == QLatin1String("eT093WRO") ||
// Swann
sensor->modelId() == QLatin1String("SWO-MOS1PA") ||
// LIDL
Expand Down Expand Up @@ -3105,18 +3024,6 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
{
val = sensor->getZclValue(*i, 0x0001); // Keypad lockout
}
else if (*i == DIAGNOSTICS_CLUSTER_ID)
{
if (sensor->modelId() == QLatin1String("TRV001") || // Hive TRV
sensor->modelId() == QLatin1String("eT093WRO")) // POPP smart thermostat
{
val = sensor->getZclValue(*i, 0x4000); // SW error code
}
else
{
continue;
}
}
else if (*i == SAMJIN_CLUSTER_ID)
{
val = sensor->getZclValue(*i, 0x0012); // Acceleration X
Expand Down
16 changes: 0 additions & 16 deletions database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3959,22 +3959,6 @@ static int sqliteLoadAllSensorsCallback(void *user, int ncols, char **colval , c
sensor.addItem(DataTypeString, RConfigMode);
sensor.addItem(DataTypeString, RConfigFanMode);
}
else if (sensor.modelId() == QLatin1String("TRV001") || // Hive TRV
sensor.modelId() == QLatin1String("eT093WRO")) // POPP smart thermostat
{
sensor.addItem(DataTypeUInt8, RStateValve);
sensor.addItem(DataTypeString, RStateWindowOpen);
sensor.addItem(DataTypeBool, RStateMountingModeActive)->setValue(false);
sensor.addItem(DataTypeString, RStateErrorCode);
sensor.addItem(DataTypeBool, RConfigDisplayFlipped)->setValue(false);
sensor.addItem(DataTypeBool, RConfigLocked)->setValue(false);
sensor.addItem(DataTypeBool, RConfigMountingMode)->setValue(false);
// Supported with Danfoss firmware version 1.08
sensor.addItem(DataTypeBool, RConfigScheduleOn)->setValue(false);
sensor.addItem(DataTypeString, RConfigSchedule);
sensor.addItem(DataTypeInt16, RConfigExternalTemperatureSensor)->setValue(0);
sensor.addItem(DataTypeBool, RConfigExternalWindowOpen)->setValue(false);
}
else if (sensor.modelId() == QLatin1String("iTRV")) // Drayton Wiser Radiator Thermostat
{
sensor.addItem(DataTypeUInt8, RStateValve);
Expand Down
1 change: 0 additions & 1 deletion de_web.pro
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ SOURCES = air_quality.cpp \
device_js/device_js_wrappers.cpp \
device_js/duktape.c \
device_tick.cpp \
diagnostics.cpp \
discovery.cpp \
de_web_plugin.cpp \
de_web_widget.cpp \
Expand Down
27 changes: 1 addition & 26 deletions de_web_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ static const SupportedDevice supportedDevices[] = {
{ VENDOR_ALERTME, "SLR2b", computimeMacPrefix }, // Hive Heating Receiver 2 channel second version
{ VENDOR_ALERTME, "SLT2", computimeMacPrefix }, // Hive thermostat
{ VENDOR_ALERTME, "SLT3", computimeMacPrefix }, // Hive thermostat
{ VENDOR_DANFOSS, "TRV001", silabs2MacPrefix }, // Hive thermostat (From Danfoss)
{ VENDOR_SUNRICHER, "4512705", silabs2MacPrefix }, // Namron remote control
{ VENDOR_SUNRICHER, "4512726", silabs2MacPrefix }, // Namron rotary switch
{ VENDOR_SUNRICHER, "S57003", silabs2MacPrefix }, // SLC 4-ch remote controller
Expand Down Expand Up @@ -484,7 +483,6 @@ static const SupportedDevice supportedDevices[] = {
{ VENDOR_SCHNEIDER, "iTRV", silabs3MacPrefix }, // Drayton Wiser Radiator Thermostat
{ VENDOR_SCHNEIDER, "CCT593011_AS", emberMacPrefix }, // LK Wiser Temperature and Humidity Sensor
{ VENDOR_SCHNEIDER, "CCT595011_AS", emberMacPrefix }, // LK Wiser Motion Sensor
{ VENDOR_DANFOSS, "eT093WRO", silabs5MacPrefix }, // POPP Smart Thermostat
{ VENDOR_DANFOSS, "0x8020", silabs6MacPrefix }, // Danfoss RT24V Display thermostat
{ VENDOR_DANFOSS, "0x8021", silabs6MacPrefix }, // Danfoss RT24V Display thermostat with floor sensor
{ VENDOR_DANFOSS, "0x8030", silabs6MacPrefix }, // Danfoss RTbattery Display thermostat
Expand Down Expand Up @@ -1313,10 +1311,6 @@ void DeRestPluginPrivate::apsdeDataIndication(const deCONZ::ApsDataIndication &i
if (!DEV_TestStrict() && !devManaged) { handleThermostatUiConfigurationClusterIndication(ind, zclFrame); }
break;

case DIAGNOSTICS_CLUSTER_ID:
if (!DEV_TestStrict() && !devManaged) { handleDiagnosticsClusterIndication(ind, zclFrame); }
break;

case IDENTIFY_CLUSTER_ID:
handleIdentifyClusterIndication(ind, zclFrame);
break;
Expand Down Expand Up @@ -6294,8 +6288,7 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const deCONZ::
case TIME_CLUSTER_ID:
{
// Many Xiaomi devices advertise non-functional Time cluster, so better use whitelist.
if (modelId == QLatin1String("Thermostat") || // eCozy
modelId == QLatin1String("eT093WRO")) // POPP smart thermostat
if (modelId == QLatin1String("Thermostat")) // eCozy
{
fpTimeSensor.inClusters.push_back(ci->id());
}
Expand Down Expand Up @@ -7541,22 +7534,6 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const SensorFi
sensorNode.addItem(DataTypeString, RConfigMode);
sensorNode.addItem(DataTypeString, RConfigFanMode);
}
else if (modelId == QLatin1String("TRV001") || // Hive TRV
modelId == QLatin1String("eT093WRO")) // POPP smart thermostat
{
sensorNode.addItem(DataTypeUInt8, RStateValve);
sensorNode.addItem(DataTypeString, RStateWindowOpen);
sensorNode.addItem(DataTypeBool, RStateMountingModeActive)->setValue(false);
sensorNode.addItem(DataTypeString, RStateErrorCode);
sensorNode.addItem(DataTypeBool, RConfigDisplayFlipped)->setValue(false);
sensorNode.addItem(DataTypeBool, RConfigLocked)->setValue(false);
sensorNode.addItem(DataTypeBool, RConfigMountingMode)->setValue(false);
// Supported with Danfoss firmware version 1.08
sensorNode.addItem(DataTypeBool, RConfigScheduleOn)->setValue(false);
sensorNode.addItem(DataTypeString, RConfigSchedule);
sensorNode.addItem(DataTypeInt16, RConfigExternalTemperatureSensor)->setValue(0);
sensorNode.addItem(DataTypeBool, RConfigExternalWindowOpen)->setValue(false);
}
else if (modelId == QLatin1String("PR412C")) // OWON PCT502 Thermostat
{
sensorNode.addItem(DataTypeBool, RConfigLocked)->setValue(false);
Expand Down Expand Up @@ -15583,10 +15560,8 @@ void DeRestPlugin::idleTimerFired()
sensorNode->modelId().startsWith(QLatin1String("SLT3")) || // Hive Active Heating Thermostat
sensorNode->modelId().startsWith(QLatin1String("SLR2")) || // Hive Active Heating Receiver 2 channel
sensorNode->modelId().startsWith(QLatin1String("SLR1b")) || // Hive Active Heating Receiver 1 channel
sensorNode->modelId().startsWith(QLatin1String("TRV001")) || // Hive TRV
sensorNode->modelId().startsWith(QLatin1String("TH112")) || // Sinope devices
sensorNode->modelId().startsWith(QLatin1String("TH1300ZB")) || // Sinope devices
sensorNode->modelId().startsWith(QLatin1String("eT093WRO")) || // POPP smart thermostat
sensorNode->modelId().startsWith(QLatin1String("0x8020")) || // Danfoss RT24V Display thermostat
sensorNode->modelId().startsWith(QLatin1String("0x8021")) || // Danfoss RT24V Display thermostat with floor sensor
sensorNode->modelId().startsWith(QLatin1String("0x8030")) || // Danfoss RTbattery Display thermostat
Expand Down
1 change: 0 additions & 1 deletion de_web_plugin_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,6 @@ public Q_SLOTS:
void handleThermostatUiConfigurationClusterIndication(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame);
void handleAirQualityClusterIndication(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame);
void handleTimeClusterIndication(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame);
void handleDiagnosticsClusterIndication(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame);
void handleFanControlClusterIndication(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame);
void handleIdentifyClusterIndication(const deCONZ::ApsDataIndication &ind, const deCONZ::ZclFrame &zclFrame);
void sendTimeClusterResponse(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame);
Expand Down
111 changes: 0 additions & 111 deletions diagnostics.cpp

This file was deleted.

Loading

0 comments on commit 4e65254

Please sign in to comment.