Fixed bug in Example 13

WindowShade was incorrectly sending repeated event notifications to HomeKit!
This commit is contained in:
Gregg 2021-03-21 12:37:12 -05:00
parent 451a2885b1
commit 54f7928204
1 changed files with 2 additions and 2 deletions

View File

@ -107,7 +107,7 @@ struct DEV_WindowShade : Service::WindowCovering { // A motorized Window Sha
// Here we simulate a window shade that takes 5 seconds to move to its new target posiiton // Here we simulate a window shade that takes 5 seconds to move to its new target posiiton
if(target->timeVal()>5000){ // if 5 seconds have elapsed since the target-position was last modified... if(current->getVal()!=target->getVal() && target->timeVal()>5000){ // if 5 seconds have elapsed since the target-position was last modified...
current->setVal(target->getVal()); // ...set the current position to equal the target position current->setVal(target->getVal()); // ...set the current position to equal the target position
} }