Пример #1
0
        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);
            });
        }
Пример #2
0
        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();
            }
        }