Skip to content

Commit

Permalink
ORVIBO smoke sensor support
Browse files Browse the repository at this point in the history
removed stray closing brace
  • Loading branch information
udoewich authored and manup committed Aug 26, 2019
1 parent 95aa010 commit 0b5e05e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1737,9 +1737,10 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
// Sinope
sensor->modelId() == QLatin1String("WL4200S") ||
//LifeControl smart plug
sensor->modelId() == QLatin1String("RICI01"))||
sensor->modelId() == QLatin1String("RICI01") ||
// ORVIBO
sensor->modelId().startsWith(QLatin1String("SN10ZW")))
sensor->modelId().startsWith(QLatin1String("SN10ZW")) ||
sensor->modelId().startsWith(QLatin1String("SF20")))
{
deviceSupported = true;
if (!sensor->node()->nodeDescriptor().receiverOnWhenIdle() ||
Expand Down
17 changes: 17 additions & 0 deletions de_web_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ static const SupportedDevice supportedDevices[] = {
{ VENDOR_EMBER, "3AFE130104020015", konkeMacPrefix }, // Konke Kit Pro-Door Entry Sensor
{ VENDOR_NONE, "RICI01", tiMacPrefix}, // LifeControl smart plug
{ VENDOR_JENNIC, "SN10ZW", jennicMacPrefix }, // ORVIBO motion sensor
{ VENDOR_OSRAM_STACK, "SF20", heimanMacPrefix }, // ORVIBO (Heiman) smoke sensor
{ 0, nullptr, 0 }
};

Expand Down Expand Up @@ -3567,6 +3568,10 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const deCONZ::
{
modelId = QLatin1String("SN10ZW motion sensor");
}
else if (modelId == QLatin1String("b5db59bfd81e4f1f95dc57fdbba17931"))
{
modelId = QLatin1String("SF20 smoke sensor");
}
}
}
}
Expand Down Expand Up @@ -3697,6 +3702,7 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const deCONZ::
modelId.startsWith(QLatin1String("Smoke")) || // Heiman fire sensor (newer model)
modelId.startsWith(QLatin1String("902010/24")) || // Bitron smoke detector
modelId.startsWith(QLatin1String("SMSZB-120")) || // Develco smoke detector
modelId.startsWith(QLatin1String("SF20")) || // ORVIBO (Heiman) smoke sensor
modelId.startsWith(QLatin1String("lumi.sensor_smoke"))) // Xiaomi Mi smoke sensor
{
// Gas sensor detects combustable gas, so fire is more appropriate than CO.
Expand Down Expand Up @@ -6056,6 +6062,17 @@ void DeRestPluginPrivate::updateSensorNode(const deCONZ::NodeEvent &event)
str = QLatin1String("SN10ZW motion sensor");
}
}
else if (str == QLatin1String("b5db59bfd81e4f1f95dc57fdbba17931"))
{
if (i->modelId().startsWith(QLatin1String("SF20")))
{
continue; // skip if already replaced
}
else
{
str = QLatin1String("SF20 smoke sensor");
}
}
i->setModelId(str);
i->setNeedSaveDatabase(true);
checkInstaModelId(&*i);
Expand Down

0 comments on commit 0b5e05e

Please sign in to comment.