예제 #1
0
        protected async Task Handle(VolumeSetCommand command)
        {
            var volume = command.AsDouble(MessageProperties.Value);
            var cmd    = GetKodiCommand("Application.SetVolume", new { volume });
            var result = await MessageBroker.QueryService <KodiCommand, JsonRpcResponse>(cmd).ConfigureAwait(false);

            _volume = await UpdateState(VolumeState.StateName, _volume, volume).ConfigureAwait(false);
        }
예제 #2
0
        protected async Task Handle(VolumeSetCommand command)
        {
            var volume = command.AsDouble(MessageProperties.Value);
            var cmd    = GetJsonCommand("audio", "setAudioVolume", new SonyAudioVolumeRequest("speaker", ((int)volume).ToString()));
            await MessageBroker.QueryJsonService <SonyJsonQuery, SonyAudioResult>(cmd);

            _volume = await UpdateState(VolumeState.StateName, _volume, volume);
        }
예제 #3
0
        protected async Task Handle(VolumeSetCommand command)
        {
            var volume = command.AsDouble(MessageProperties.Value);
            var cmd    = new ComputerCommand
            {
                Address = _hostname,
                Service = "Volume",
                Message = new VolumePost {
                    Volume = volume
                }
            };
            await MessageBroker.SendToService(cmd).ConfigureAwait(false);

            _volume = await UpdateState(VolumeState.StateName, _volume, volume).ConfigureAwait(false);
        }
예제 #4
0
        protected async Task Handle(VolumeSetCommand command)
        {
            var volume     = command.AsDouble(MessageProperties.Value);
            var normalized = NormalizeVolume(volume);

            var control = new DenonControlQuery
            {
                Command    = normalized,
                Api        = "formiPhoneAppVolume",
                ReturnNode = "MasterVolume",
                Address    = _hostName,
                Zone       = _zone.ToString()
            };

            await MessageBroker.QueryService <DenonControlQuery, string>(control).ConfigureAwait(false);

            _volume = await UpdateState(VolumeState.StateName, _volume, volume).ConfigureAwait(false);
        }