Skip to content

Tuya thermostat and switch improvements, Kwikset 914 smart lock #3457

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

Merged
merged 18 commits into from
Nov 15, 2020
Merged

Tuya thermostat and switch improvements, Kwikset 914 smart lock #3457

merged 18 commits into from
Nov 15, 2020

Conversation

Smanar
Copy link
Collaborator

@Smanar Smanar commented Oct 20, 2020

Not tuya stuff

This was linked to issues Oct 20, 2020
@manup
Copy link
Member

manup commented Nov 8, 2020

The PR is a bit too large. For the upcoming stable version I'd like to merge only the fixes but not new supported devices.
Can you please create another PR with only the fixes based on current master branch and git cherry pick the related commits?

@Mimiix
Copy link
Collaborator

Mimiix commented Nov 9, 2020

@manup I'd like to remind you: We agreed on having no changes in stable releases. Stable has to be 100% of latest beta + any small fixes that occurred since then(Xiaomi vib sensor for example).

@Smanar
Copy link
Collaborator Author

Smanar commented Nov 9, 2020

I m agree, PR are too "meshed" (can't make small fixes with it) and code is too "sensible", can wait for beta, I will correct conflict later.

@Smanar Smanar linked an issue Nov 10, 2020 that may be closed by this pull request
@manup manup changed the title Tuya improvement Tuya thermostat and switch improvements, Kwikset 914 smart lock Nov 14, 2020
@manup
Copy link
Member

manup commented Nov 14, 2020

I've changed the PR title and description to be more specific about for which devices the changes are.

Copy link
Member

@manup manup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a few comments, note some do apply to multiple code locations which I didn't comment.

@Smanar Smanar requested a review from manup November 14, 2020 21:08
tuya.cpp Outdated
else if (data == 1) { mode = QLatin1String("auto"); } // back to "auto"
else
{
DBG_Assert(data <= 0); // unsupported
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DBG_Assert(data <= 1); // unsupported

tuya.cpp Outdated
else if (data == 6) { preset = QLatin1String("complex"); }
else
{
DBG_Assert(data <= 0); // unsupported
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DBG_Assert(data <= 6); // unsupported

tuya.cpp Outdated
else if (dp == 0x0403) { preset = QLatin1String("program"); }
else
{
DBG_Assert(data <= 0); // unsupported
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DBG_Assert(data == 0x0402 || data == 0x0403); // unsupported

tuya.cpp Outdated
else if (data == 1) { mode = QLatin1String("manu"); }
else
{
DBG_Assert(data <= 0); // unsupported
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DBG_Assert(data <= 1); // unsupported

tuya.cpp Outdated
else if (data == 1) { mode = QLatin1String("heat"); }
else
{
DBG_Assert(data <= 0); // unsupported
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DBG_Assert(data <= 1); // unsupported

tuya.cpp Outdated
Comment on lines 242 to 245
if (part > 0 && listday.size() >= static_cast<int>(part))
{
updateThermostatSchedule(sensorNode, listday.at(part - 1), transitions);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check is good now, but updateThermostatSchedule() will never be called because due the prior for loop part will always be decremented down to 0.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to admit I don't understand the logic here. Is this supposed to be within the loop?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, there is something not finished here #3457 (comment)
Not enought time to test it, and as I don't want to broke something, I had let the old tested version.

Have corrected the code, schedule is not the more important ATM.

@Smanar Smanar requested a review from manup November 15, 2020 13:42
@manup manup merged commit 22e275b into dresden-elektronik:master Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants