From b879bb8a461451c5b1d759a4c80a78c2b9b1642f Mon Sep 17 00:00:00 2001 From: M Date: Tue, 22 Oct 2019 10:17:19 +0200 Subject: [PATCH] Fix compilation and clang warnings from PR #1964 PR: https://github.com/dresden-elektronik/deconz-rest-plugin/pull/1964 --- de_web_plugin.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/de_web_plugin.cpp b/de_web_plugin.cpp index a29250e57d..c66e942733 100644 --- a/de_web_plugin.cpp +++ b/de_web_plugin.cpp @@ -3881,7 +3881,7 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const deCONZ:: case TEMPERATURE_MEASUREMENT_CLUSTER_ID: { - if (modelId.startsWith(QLatin1String("VOC_Sensor") && i->endpoint() == 0x01) + if (modelId.startsWith(QLatin1String("VOC_Sensor")) && i->endpoint() == 0x01) { fpHumiditySensor.inClusters.push_back(ci->id()); } @@ -3894,7 +3894,7 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const deCONZ:: case RELATIVE_HUMIDITY_CLUSTER_ID: { - if (modelId.startsWith(QLatin1String("VOC_Sensor")) + if (modelId.startsWith(QLatin1String("VOC_Sensor"))) { // Ignore RELATIVE HUMIDITY CLUSTER } @@ -4017,7 +4017,7 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const deCONZ:: case THERMOSTAT_CLUSTER_ID: { - if (modelId.startsWith(QLatin1String("VOC_Sensor")) + if (modelId.startsWith(QLatin1String("VOC_Sensor"))) { // Ignore THERMOSTAT CLUSTER } @@ -5784,7 +5784,6 @@ void DeRestPluginPrivate::updateSensorNode(const deCONZ::NodeEvent &event) updateSensorEtag(&*i); } - else if (i->modelId().startsWith(QLatin1String("VOC_Sensor")) && ia->id() == 0x0001) // LifeControl MCLH-08 relative humidity { // humidity sensor values are transferred via temperature cluster 0x0001 attribute @@ -5804,7 +5803,7 @@ void DeRestPluginPrivate::updateSensorNode(const deCONZ::NodeEvent &event) ResourceItem *item2 = i->item(RConfigOffset); if (item2 && item2->toNumber() != 0) { - qint16 _humidity = humidity + item2->toNumber(); + int _humidity = humidity + static_cast(item2->toNumber()); humidity = _humidity < 0 ? 0 : _humidity > 10000 ? 10000 : _humidity; } item->setValue(humidity); @@ -5816,7 +5815,7 @@ void DeRestPluginPrivate::updateSensorNode(const deCONZ::NodeEvent &event) } updateSensorEtag(&*i); - } + } } } else if (event.clusterId() == RELATIVE_HUMIDITY_CLUSTER_ID)