For some reason, DisableThing( ) completes execution before CalculateStatus( ). I need CalculateStatus( ) to complete execution before DisableThing( ), because I need it to change status to "Muted" before it gets disabled. I know DisableThing( ) completes execution before CalculateStatus( ), because I saw in the script log that it tried to run line 7 (CaculateStaus) after the asset Thing was disabled. Please see the screenshot below:
It seems that CalculateStatus( ) executes at least 7 seconds after the muteAsset( ) service was called. How can I get CalculateStatus( ) to execute before DisableThing( )?