private async void SetAwayModeAsync(bool isAway) { Structure structure = GetFirstStructure(); if (structure.IsAway == isAway) { return; } await PauseStatusProviderWhile(async() => { structure.IsAway = isAway; await _nestWebService.SetAwayMode(structure, isAway); }); }
private async void SetAwayModeAsync(bool isAway) { Structure structure = GetFirstStructure(); if (structure.IsAway == isAway) { return; } try { _statusProvider.Stop(); structure.IsAway = isAway; await _nestWebService.SetAwayMode(structure, isAway); } finally { _statusProvider.Start(); } }