-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slp2 #3005
Slp2 #3005
Conversation
bindings.cpp
Outdated
else if (sensor && (sensor->modelId() == QLatin1String("SLT2"))) | ||
{ | ||
rq.attributeId = 0x0020; // battery voltage | ||
rq.minInterval = 3600; | ||
rq.maxInterval = 3600; | ||
rq.reportableChange8bit = 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just move the modelid like 20 lines up to prevent unnecessary code
// Hive devices, don't show model id faster enought | ||
if ((node->nodeDescriptor().manufacturerCode() == VENDOR_ALERTME) && (modelId.isEmpty())) | ||
{ | ||
} | ||
// Don't create entry for the plug | ||
else if (modelId == QLatin1String("SLP2b")) | ||
{ | ||
} | ||
// Don't create entry for cluster 0x07 and 0x08 | ||
else if ((modelId == QLatin1String("SLR2")) && (i->endpoint() > 0x06 )) | ||
{ | ||
} | ||
else | ||
{ | ||
fpTemperatureSensor.inClusters.push_back(ci->id()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better with ||
to safe some lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDK, It don't make a big difference on compiled file.
And I think like this it's easier to understand, It s not like your previous comment (the modelID enumeration)
The first test is to skip the test if there is no model ID, the second is a modelid check, the third is endpoint specific and can change later (there is some "black zone" on theses devices)
Adding devices from Hives
The PR is finished.
We still missing the second relay for SLR2, but need gateway sniffing, so will be done later.