Skip to content
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

Merged
merged 24 commits into from
Jul 10, 2020
Merged

Slp2 #3005

merged 24 commits into from
Jul 10, 2020

Conversation

Smanar
Copy link
Collaborator

@Smanar Smanar commented Jul 1, 2020

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.

bindings.cpp Outdated
Comment on lines 1215 to 1221
else if (sensor && (sensor->modelId() == QLatin1String("SLT2")))
{
rq.attributeId = 0x0020; // battery voltage
rq.minInterval = 3600;
rq.maxInterval = 3600;
rq.reportableChange8bit = 0;
}
Copy link
Collaborator

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

Comment on lines +4314 to +4329
// 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());
}
Copy link
Collaborator

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?

Copy link
Collaborator Author

@Smanar Smanar Jul 2, 2020

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)

@manup manup merged commit 2549f76 into dresden-elektronik:master Jul 10, 2020
@Smanar Smanar deleted the SLP2 branch July 11, 2020 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants