Пример #1
0
        public async Task <bool> SetStatus(string message, bool isError)
        {
            _currentStatus.Message = message;
            _currentStatus.IsError = isError;
            string replyBody = JsonConvert.SerializeObject(_currentStatus);
            var    result    = await _subscriptionHandler.ReplyAll(_api, "Changed", replyBody);

            return(true);
        }
Пример #2
0
        public async Task <bool> UpdateState(Volume change)
        {
            VolumeControlsChanged changed = new VolumeControlsChanged {
                Controls = new Volume[] { change }
            };
            string replyBody = JsonConvert.SerializeObject(changed);
            var    result    = await _subscriptionHandler.ReplyAll(_api, "Changed", replyBody);

            return(true);
        }
Пример #3
0
        public async Task <bool> UpdateSettings(bool hasError = false)
        {
            SettingsAll settings = new SettingsAll {
                Settings = new LayoutAndSettings {
                    Layout = _layout.ToArray(), Values = _values, HasError = hasError
                }
            };
            string replyBody = JsonConvert.SerializeObject(settings);
            var    result    = await _subscriptionHandler.ReplyAll(_api, "Changed", replyBody);

            return(true);
        }