Skip to content

Commit ba05ea1

Browse files
committed
Merge branch 'samjin_1' into stable
2 parents 77cc987 + 675621f commit ba05ea1

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

bindings.cpp

+20-7
Original file line numberDiff line numberDiff line change
@@ -937,12 +937,12 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
937937
{
938938
// Only configure periodic reports, as events are already sent though zone status change notification commands
939939
rq.minInterval = 300;
940-
rq.maxInterval = 300;
940+
rq.maxInterval = 3600;
941941
}
942942
else
943943
{
944-
rq.minInterval = 1;
945-
rq.maxInterval = 300;
944+
rq.minInterval = 300;
945+
rq.maxInterval = 3600;
946946

947947
const ResourceItem *item = sensor ? sensor->item(RConfigDuration) : nullptr;
948948

@@ -1674,6 +1674,13 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
16741674
rq.maxInterval = 43200; // according to technical manual
16751675
rq.reportableChange8bit = 0;
16761676
}
1677+
else if (sensor && sensor->manufacturer() == QLatin1String("Samjin"))
1678+
{
1679+
// https://github.com/SmartThingsCommunity/SmartThingsPublic/blob/master/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy
1680+
rq.minInterval = 30;
1681+
rq.maxInterval = 21600;
1682+
rq.reportableChange8bit = 10;
1683+
}
16771684
else
16781685
{
16791686
rq.minInterval = 300;
@@ -2007,30 +2014,30 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
20072014
rq.attributeId = 0x0010; // active
20082015
rq.minInterval = manufacturerCode == VENDOR_SAMJIN ? 0 : 10;
20092016
rq.maxInterval = 3600;
2010-
rq.reportableChange8bit = 1;
2017+
rq.reportableChange8bit = 0xFF;
20112018
rq.manufacturerCode = manufacturerCode;
20122019

20132020
ConfigureReportingRequest rq1;
20142021
rq1.dataType = deCONZ::Zcl16BitInt;
20152022
rq1.attributeId = 0x0012; // acceleration x
20162023
rq1.minInterval = minInterval;
2017-
rq1.maxInterval = 300;
2024+
rq1.maxInterval = 3600;
20182025
rq1.reportableChange16bit = 1;
20192026
rq1.manufacturerCode = manufacturerCode;
20202027

20212028
ConfigureReportingRequest rq2;
20222029
rq2.dataType = deCONZ::Zcl16BitInt;
20232030
rq2.attributeId = 0x0013; // acceleration y
20242031
rq2.minInterval = minInterval;
2025-
rq2.maxInterval = 300;
2032+
rq2.maxInterval = 3600;
20262033
rq2.reportableChange16bit = 1;
20272034
rq2.manufacturerCode = manufacturerCode;
20282035

20292036
ConfigureReportingRequest rq3;
20302037
rq3.dataType = deCONZ::Zcl16BitInt;
20312038
rq3.attributeId = 0x0014; // acceleration z
20322039
rq3.minInterval = minInterval;
2033-
rq3.maxInterval = 300;
2040+
rq3.maxInterval = 3600;
20342041
rq3.reportableChange16bit = 1;
20352042
rq3.manufacturerCode = manufacturerCode;
20362043

@@ -2909,6 +2916,12 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
29092916
{
29102917
continue; // process only once
29112918
}
2919+
2920+
if (sensor->manufacturer() == QLatin1String("Samjin") && sensor->modelId() == QLatin1String("multi") && sensor->type() != QLatin1String("ZHAOpenClose"))
2921+
{
2922+
continue; // process only once
2923+
}
2924+
29122925
if (sensor->modelId() == QLatin1String("Remote switch") ||
29132926
sensor->modelId() == QLatin1String("Shutters central remote switch") ||
29142927
sensor->modelId() == QLatin1String("Double gangs remote switch") ||

de_web_plugin.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -12499,6 +12499,13 @@ void DeRestPluginPrivate::sendZclDefaultResponse(const deCONZ::ApsDataIndication
1249912499
deCONZ::ZclFCDirectionClientToServer |
1250012500
deCONZ::ZclFCDisableDefaultResponse);
1250112501

12502+
12503+
if (zclFrame.manufacturerCode_t() != 0x0000_mfcode)
12504+
{
12505+
outZclFrame.setFrameControl(outZclFrame.frameControl() | deCONZ::ZclFCManufacturerSpecific);
12506+
outZclFrame.setManufacturerCode(zclFrame.manufacturerCode_t());
12507+
}
12508+
1250212509
{ // ZCL payload
1250312510
QDataStream stream(&outZclFrame.payload(), QIODevice::WriteOnly);
1250412511
stream.setByteOrder(QDataStream::LittleEndian);

de_web_plugin_private.h

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
#include "websocket_server.h"
4141
#include "tuya.h"
4242

43+
// enable domain specific string literals
44+
using namespace deCONZ::literals;
45+
4346
#if defined(Q_OS_LINUX) && !defined(Q_PROCESSOR_X86)
4447
// Workaround to detect ARM and AARCH64 in older Qt versions.
4548
#define ARCH_ARM

0 commit comments

Comments
 (0)