You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// create a telnet client with a list of IP addressesvartelnetClient=newSimpleTelnetClient("192.168.1.43","192.168.1.45","192.168.1.47");// create a HEOS clientvarheosClient=newHeosClient(telnetClient,CancellationToken.None);// subscribe to all eventsheosClient.EventObservable.Subscribe(o =>{switch(o){casePlayerStateChangedEvente:Console.WriteLine($"Player {e.PlayerId}: state = {e.State}");break;casePlayerNowPlayingProgressEvente:Console.WriteLine($"Player {e.PlayerId}: position = {e.Position}");break;}});// subscribe to the volume changed eventheosClient.EventObservable.OfType<PlayerVolumeChangedEvent>().Subscribe(e =>{Console.WriteLine($"Player {e.PlayerId}: volume = {e.Volume}, mute = {e.Mute}");});varcommandProcessor=newCommandProcessor(heosClient);// request change eventsvarsetChangeEventsCommandResponse=awaitcommandProcessor.Execute(newSetChangeEventsCommand(true));// get all players, ensure there is at least 1 playervargetPlayersResponse=awaitcommandProcessor.Execute(newGetPlayersCommand(), r =>r.Any(),5,TimeSpan.FromSeconds(5),TimeSpan.FromSeconds(2));if(getPlayersResponse.Success){Console.WriteLine("Found players: "+string.Join(", ",getPlayersResponse.Payload.Select(p =>p.Name)));}