示例#1
0
        public async Task CallServiceAsync(string domain, string service, IDictionary <string, object> serviceData = null, CancellationToken cancellationToken = default)
        {
            var callServiceCommand       = new CallServiceCommand(domain, service, serviceData);
            var callServiceCommandResult = await ConnectionService.SendCommandAsync <CallServiceCommand, CallServiceCommandResult>(callServiceCommand, cancellationToken);

            callServiceCommandResult.EnsureSuccessResult();
        }
示例#2
0
 public AsyncContextOperation Send(CallServiceCommand command) => Send(command as HomeAssistantCommand);