Code cleanup in bindings.cpp
@@ -1106,7 +1106,8 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
rq.dataType = deCONZ::Zcl8BitUint;
rq.attributeId = 0x0021; // battery percentage remaining
- if (sensor && sensor->modelId().startsWith(QLatin1String("SML00"))) // Hue motion sensor
+ if (sensor && (sensor->modelId().startsWith(QLatin1String("SML00")) || // Hue motion sensor
+ sensor->modelId().startsWith(QLatin1String("SPZB"))) // Eurotronic Spirit
{
rq.minInterval = 7200; // value used by Hue bridge
rq.maxInterval = 7200; // value used by Hue bridge
@@ -1129,14 +1130,8 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
else if (sensor && (sensor->modelId() == QLatin1String("Motion Sensor-A") ||
sensor->modelId() == QLatin1String("tagv4") ||
sensor->modelId() == QLatin1String("motionv4") ||
- sensor->modelId() == QLatin1String("RFDL-ZB-MS")))
- {
- rq.attributeId = 0x0020; // battery voltage
- rq.minInterval = 3600;
- rq.maxInterval = 3600;
- rq.reportableChange8bit = 0;
- }
- else if (sensor && sensor->modelId() == QLatin1String("Zen-01"))
+ sensor->modelId() == QLatin1String("RFDL-ZB-MS") ||
+ sensor->modelId() == QLatin1String("Zen-01")))
{
rq.attributeId = 0x0020; // battery voltage
rq.minInterval = 3600;
@@ -1155,12 +1150,6 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
rq.maxInterval = 43200; // according to technical manual
rq.reportableChange8bit = 0;
}
- else if (sensor && sensor->modelId().startsWith(QLatin1String("SPZB"))) // Eurotronic Spirit
- {
- rq.minInterval = 7200; // same as Hue motion sensor
- rq.maxInterval = 7200; // same as Hue motion sensor
- rq.reportableChange8bit = 0; // same as Hue motion sensor
- }
else
{
rq.minInterval = 300;
