Skip to content

Commit

Permalink
Fix compilation and clang warnings from PR dresden-elektronik#1964
Browse files Browse the repository at this point in the history
  • Loading branch information
manup committed Oct 22, 2019
1 parent ac43c16 commit b879bb8
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions de_web_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand All @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand All @@ -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<int>(item2->toNumber());
humidity = _humidity < 0 ? 0 : _humidity > 10000 ? 10000 : _humidity;
}
item->setValue(humidity);
Expand All @@ -5816,7 +5815,7 @@ void DeRestPluginPrivate::updateSensorNode(const deCONZ::NodeEvent &event)
}

updateSensorEtag(&*i);
}
}
}
}
else if (event.clusterId() == RELATIVE_HUMIDITY_CLUSTER_ID)
Expand Down

0 comments on commit b879bb8

Please sign in to comment.