Skip to content

Commit

Permalink
Fix bug where commands containing transition field and a status/brigh…
Browse files Browse the repository at this point in the history
…tness field would generate conflicting transitions
  • Loading branch information
sidoh committed Aug 6, 2019
1 parent e86658c commit b90c669
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/MiLight/MiLightClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,13 @@ void MiLightClient::update(JsonObject request) {

// Always turn on first
if (parsedStatus == ON) {
if (transition == 0) {
if (
transition == 0
// Do not generate a transition if a brightness field is also set, since that will also
// generate a transition.
|| request.containsKey(GroupStateFieldNames::BRIGHTNESS)
|| request.containsKey(GroupStateFieldNames::LEVEL)
) {
this->updateStatus(ON);
} else {
handleTransition(GroupStateField::STATUS, status, transition);
Expand Down

0 comments on commit b90c669

Please sign in to comment.