pub struct SonosDevice { /* private fields */ }Implementations§
Source§impl SonosDevice
impl SonosDevice
Sourcepub async fn subscribe_av_transport(
&self,
) -> Result<EventStream<AVTransportEvent>>
pub async fn subscribe_av_transport( &self, ) -> Result<EventStream<AVTransportEvent>>
Subscribe to events from the AVTransport service on this device
Source§impl SonosDevice
impl SonosDevice
Sourcepub async fn subscribe_alarm_clock(
&self,
) -> Result<EventStream<AlarmClockEvent>>
pub async fn subscribe_alarm_clock( &self, ) -> Result<EventStream<AlarmClockEvent>>
Subscribe to events from the AlarmClock service on this device
Source§impl SonosDevice
impl SonosDevice
Sourcepub async fn subscribe_audio_in(&self) -> Result<EventStream<AudioInEvent>>
pub async fn subscribe_audio_in(&self) -> Result<EventStream<AudioInEvent>>
Subscribe to events from the AudioIn service on this device
Source§impl SonosDevice
impl SonosDevice
Sourcepub async fn subscribe_connection_manager(
&self,
) -> Result<EventStream<ConnectionManagerEvent>>
pub async fn subscribe_connection_manager( &self, ) -> Result<EventStream<ConnectionManagerEvent>>
Subscribe to events from the ConnectionManager service on this device
Source§impl SonosDevice
impl SonosDevice
Sourcepub async fn subscribe_content_directory(
&self,
) -> Result<EventStream<ContentDirectoryEvent>>
pub async fn subscribe_content_directory( &self, ) -> Result<EventStream<ContentDirectoryEvent>>
Subscribe to events from the ContentDirectory service on this device
Source§impl SonosDevice
impl SonosDevice
Sourcepub async fn subscribe_device_properties(
&self,
) -> Result<EventStream<DevicePropertiesEvent>>
pub async fn subscribe_device_properties( &self, ) -> Result<EventStream<DevicePropertiesEvent>>
Subscribe to events from the DeviceProperties service on this device
Source§impl SonosDevice
impl SonosDevice
Sourcepub async fn subscribe_group_management(
&self,
) -> Result<EventStream<GroupManagementEvent>>
pub async fn subscribe_group_management( &self, ) -> Result<EventStream<GroupManagementEvent>>
Subscribe to events from the GroupManagement service on this device
Source§impl SonosDevice
impl SonosDevice
Sourcepub async fn subscribe_group_rendering_control(
&self,
) -> Result<EventStream<GroupRenderingControlEvent>>
pub async fn subscribe_group_rendering_control( &self, ) -> Result<EventStream<GroupRenderingControlEvent>>
Subscribe to events from the GroupRenderingControl service on this device
Source§impl SonosDevice
impl SonosDevice
Sourcepub async fn subscribe_ht_control(&self) -> Result<EventStream<HTControlEvent>>
pub async fn subscribe_ht_control(&self) -> Result<EventStream<HTControlEvent>>
Subscribe to events from the HTControl service on this device
Source§impl SonosDevice
impl SonosDevice
Sourcepub async fn subscribe_music_services(
&self,
) -> Result<EventStream<MusicServicesEvent>>
pub async fn subscribe_music_services( &self, ) -> Result<EventStream<MusicServicesEvent>>
Subscribe to events from the MusicServices service on this device
Source§impl SonosDevice
impl SonosDevice
Sourcepub async fn subscribe_queue(&self) -> Result<EventStream<QueueEvent>>
pub async fn subscribe_queue(&self) -> Result<EventStream<QueueEvent>>
Subscribe to events from the Queue service on this device
Source§impl SonosDevice
impl SonosDevice
Sourcepub async fn subscribe_rendering_control(
&self,
) -> Result<EventStream<RenderingControlEvent>>
pub async fn subscribe_rendering_control( &self, ) -> Result<EventStream<RenderingControlEvent>>
Subscribe to events from the RenderingControl service on this device
Source§impl SonosDevice
impl SonosDevice
Sourcepub async fn subscribe_system_properties(
&self,
) -> Result<EventStream<SystemPropertiesEvent>>
pub async fn subscribe_system_properties( &self, ) -> Result<EventStream<SystemPropertiesEvent>>
Subscribe to events from the SystemProperties service on this device
Source§impl SonosDevice
impl SonosDevice
Sourcepub async fn subscribe_virtual_line_in(
&self,
) -> Result<EventStream<VirtualLineInEvent>>
pub async fn subscribe_virtual_line_in( &self, ) -> Result<EventStream<VirtualLineInEvent>>
Subscribe to events from the VirtualLineIn service on this device
Source§impl SonosDevice
impl SonosDevice
Sourcepub async fn subscribe_zone_group_topology(
&self,
) -> Result<EventStream<ZoneGroupTopologyEvent>>
pub async fn subscribe_zone_group_topology( &self, ) -> Result<EventStream<ZoneGroupTopologyEvent>>
Subscribe to events from the ZoneGroupTopology service on this device
Source§impl SonosDevice
impl SonosDevice
Sourcepub async fn from_ip(addr: Ipv4Addr) -> Result<Self>
pub async fn from_ip(addr: Ipv4Addr) -> Result<Self>
Constructs a SonosDevice from the supplied IP Address. Validates that the device is actually a Sonos device before returning successfully.
Sourcepub async fn for_room(room_name: &str) -> Result<Self>
pub async fn for_room(room_name: &str) -> Result<Self>
Resolves the SonosDevice whose name is equal to the provided
name. If no matching device is found within a reasonably
short, unspecified, implementation-defined timeout, then
an Error::RoomNotFound is produced.
Sourcepub async fn from_url(url: Url) -> Result<Self>
pub async fn from_url(url: Url) -> Result<Self>
Constructs a SonosDevice from the supplied URL, which must be the device_description.xml URL for that device. Validates that the device is actually a Sonos device before returning successfully.
Sourcepub async fn get_zone_group_state(&self) -> Result<Vec<ZoneGroup>>
pub async fn get_zone_group_state(&self) -> Result<Vec<ZoneGroup>>
Returns information about the zone to which this device belongs
Sourcepub async fn queue_clear(&self) -> Result<()>
pub async fn queue_clear(&self) -> Result<()>
Clears the queue
pub async fn set_play_mode(&self, new_play_mode: CurrentPlayMode) -> Result<()>
pub async fn set_av_transport_uri( &self, uri: &str, metadata: Option<TrackMetaData>, ) -> Result<()>
pub async fn queue_prepend( &self, uri: &str, metadata: Option<TrackMetaData>, ) -> Result<AddUriToQueueResponse>
pub async fn queue_append( &self, uri: &str, metadata: Option<TrackMetaData>, ) -> Result<AddUriToQueueResponse>
pub async fn queue_browse( &self, starting_index: u32, requested_count: u32, ) -> Result<Vec<TrackMetaData>>
pub fn url(&self) -> &Url
Source§impl SonosDevice
impl SonosDevice
pub fn device_spec(&self) -> &DeviceSpec
pub async fn subscribe_helper<T: DecodeXml + 'static>( &self, service: &str, ) -> Result<EventStream<T>>
Trait Implementations§
Source§impl AVTransport for SonosDevice
impl AVTransport for SonosDevice
async fn add_multiple_uris_to_queue( &self, request: AddMultipleUrisToQueueRequest, ) -> Result<AddMultipleUrisToQueueResponse>
Source§async fn add_uri_to_queue(
&self,
request: AddUriToQueueRequest,
) -> Result<AddUriToQueueResponse>
async fn add_uri_to_queue( &self, request: AddUriToQueueRequest, ) -> Result<AddUriToQueueResponse>
async fn add_uri_to_saved_queue( &self, request: AddUriToSavedQueueRequest, ) -> Result<AddUriToSavedQueueResponse>
async fn backup_queue(&self, request: BackupQueueRequest) -> Result<()>
Source§async fn become_coordinator_of_standalone_group(
&self,
request: BecomeCoordinatorOfStandaloneGroupRequest,
) -> Result<BecomeCoordinatorOfStandaloneGroupResponse>
async fn become_coordinator_of_standalone_group( &self, request: BecomeCoordinatorOfStandaloneGroupRequest, ) -> Result<BecomeCoordinatorOfStandaloneGroupResponse>
async fn become_group_coordinator( &self, request: BecomeGroupCoordinatorRequest, ) -> Result<()>
async fn become_group_coordinator_and_source( &self, request: BecomeGroupCoordinatorAndSourceRequest, ) -> Result<()>
async fn change_coordinator( &self, request: ChangeCoordinatorRequest, ) -> Result<()>
async fn change_transport_settings( &self, request: ChangeTransportSettingsRequest, ) -> Result<()>
Source§async fn configure_sleep_timer(
&self,
request: ConfigureSleepTimerRequest,
) -> Result<()>
async fn configure_sleep_timer( &self, request: ConfigureSleepTimerRequest, ) -> Result<()>
async fn create_saved_queue( &self, request: CreateSavedQueueRequest, ) -> Result<CreateSavedQueueResponse>
Source§async fn delegate_group_coordination_to(
&self,
request: DelegateGroupCoordinationToRequest,
) -> Result<()>
async fn delegate_group_coordination_to( &self, request: DelegateGroupCoordinationToRequest, ) -> Result<()>
async fn end_direct_control_session( &self, request: EndDirectControlSessionRequest, ) -> Result<()>
Source§async fn get_crossfade_mode(
&self,
request: GetCrossfadeModeRequest,
) -> Result<GetCrossfadeModeResponse>
async fn get_crossfade_mode( &self, request: GetCrossfadeModeRequest, ) -> Result<GetCrossfadeModeResponse>
Source§async fn get_current_transport_actions(
&self,
request: GetCurrentTransportActionsRequest,
) -> Result<GetCurrentTransportActionsResponse>
async fn get_current_transport_actions( &self, request: GetCurrentTransportActionsRequest, ) -> Result<GetCurrentTransportActionsResponse>
async fn get_device_capabilities( &self, request: GetDeviceCapabilitiesRequest, ) -> Result<GetDeviceCapabilitiesResponse>
Source§async fn get_media_info(
&self,
request: GetMediaInfoRequest,
) -> Result<GetMediaInfoResponse>
async fn get_media_info( &self, request: GetMediaInfoRequest, ) -> Result<GetMediaInfoResponse>
Source§async fn get_position_info(
&self,
request: GetPositionInfoRequest,
) -> Result<GetPositionInfoResponse>
async fn get_position_info( &self, request: GetPositionInfoRequest, ) -> Result<GetPositionInfoResponse>
Source§async fn get_remaining_sleep_timer_duration(
&self,
request: GetRemainingSleepTimerDurationRequest,
) -> Result<GetRemainingSleepTimerDurationResponse>
async fn get_remaining_sleep_timer_duration( &self, request: GetRemainingSleepTimerDurationRequest, ) -> Result<GetRemainingSleepTimerDurationResponse>
async fn get_running_alarm_properties( &self, request: GetRunningAlarmPropertiesRequest, ) -> Result<GetRunningAlarmPropertiesResponse>
Source§async fn get_transport_info(
&self,
request: GetTransportInfoRequest,
) -> Result<GetTransportInfoResponse>
async fn get_transport_info( &self, request: GetTransportInfoRequest, ) -> Result<GetTransportInfoResponse>
Source§async fn get_transport_settings(
&self,
request: GetTransportSettingsRequest,
) -> Result<GetTransportSettingsResponse>
async fn get_transport_settings( &self, request: GetTransportSettingsRequest, ) -> Result<GetTransportSettingsResponse>
async fn notify_deleted_uri( &self, request: NotifyDeletedUriRequest, ) -> Result<()>
Source§async fn remove_all_tracks_from_queue(
&self,
request: RemoveAllTracksFromQueueRequest,
) -> Result<()>
async fn remove_all_tracks_from_queue( &self, request: RemoveAllTracksFromQueueRequest, ) -> Result<()>
async fn remove_track_from_queue( &self, request: RemoveTrackFromQueueRequest, ) -> Result<()>
Source§async fn remove_track_range_from_queue(
&self,
request: RemoveTrackRangeFromQueueRequest,
) -> Result<RemoveTrackRangeFromQueueResponse>
async fn remove_track_range_from_queue( &self, request: RemoveTrackRangeFromQueueRequest, ) -> Result<RemoveTrackRangeFromQueueResponse>
async fn reorder_tracks_in_queue( &self, request: ReorderTracksInQueueRequest, ) -> Result<()>
async fn reorder_tracks_in_saved_queue( &self, request: ReorderTracksInSavedQueueRequest, ) -> Result<ReorderTracksInSavedQueueResponse>
async fn run_alarm(&self, request: RunAlarmRequest) -> Result<()>
Source§async fn save_queue(
&self,
request: SaveQueueRequest,
) -> Result<SaveQueueResponse>
async fn save_queue( &self, request: SaveQueueRequest, ) -> Result<SaveQueueResponse>
Source§async fn seek(&self, request: SeekRequest) -> Result<()>
async fn seek(&self, request: SeekRequest) -> Result<()>
Source§async fn set_av_transport_uri(
&self,
request: SetAvTransportUriRequest,
) -> Result<()>
async fn set_av_transport_uri( &self, request: SetAvTransportUriRequest, ) -> Result<()>
Source§async fn set_crossfade_mode(
&self,
request: SetCrossfadeModeRequest,
) -> Result<()>
async fn set_crossfade_mode( &self, request: SetCrossfadeModeRequest, ) -> Result<()>
async fn set_next_av_transport_uri( &self, request: SetNextAvTransportUriRequest, ) -> Result<()>
Source§async fn set_play_mode(&self, request: SetPlayModeRequest) -> Result<()>
async fn set_play_mode(&self, request: SetPlayModeRequest) -> Result<()>
Source§async fn snooze_alarm(&self, request: SnoozeAlarmRequest) -> Result<()>
async fn snooze_alarm(&self, request: SnoozeAlarmRequest) -> Result<()>
async fn start_autoplay(&self, request: StartAutoplayRequest) -> Result<()>
Source§impl AlarmClock for SonosDevice
impl AlarmClock for SonosDevice
Source§async fn create_alarm(
&self,
request: CreateAlarmRequest,
) -> Result<CreateAlarmResponse>
async fn create_alarm( &self, request: CreateAlarmRequest, ) -> Result<CreateAlarmResponse>
Source§async fn destroy_alarm(&self, request: DestroyAlarmRequest) -> Result<()>
async fn destroy_alarm(&self, request: DestroyAlarmRequest) -> Result<()>
async fn get_daily_index_refresh_time( &self, ) -> Result<GetDailyIndexRefreshTimeResponse>
async fn get_format(&self) -> Result<GetFormatResponse>
async fn get_household_time_at_stamp( &self, request: GetHouseholdTimeAtStampRequest, ) -> Result<GetHouseholdTimeAtStampResponse>
async fn get_time_now(&self) -> Result<GetTimeNowResponse>
async fn get_time_server(&self) -> Result<GetTimeServerResponse>
async fn get_time_zone(&self) -> Result<GetTimeZoneResponse>
async fn get_time_zone_and_rule(&self) -> Result<GetTimeZoneAndRuleResponse>
async fn get_time_zone_rule( &self, request: GetTimeZoneRuleRequest, ) -> Result<GetTimeZoneRuleResponse>
Source§async fn list_alarms(&self) -> Result<ListAlarmsResponse>
async fn list_alarms(&self) -> Result<ListAlarmsResponse>
async fn set_daily_index_refresh_time( &self, request: SetDailyIndexRefreshTimeRequest, ) -> Result<()>
async fn set_format(&self, request: SetFormatRequest) -> Result<()>
async fn set_time_now(&self, request: SetTimeNowRequest) -> Result<()>
async fn set_time_server(&self, request: SetTimeServerRequest) -> Result<()>
async fn set_time_zone(&self, request: SetTimeZoneRequest) -> Result<()>
Source§async fn update_alarm(&self, request: UpdateAlarmRequest) -> Result<()>
async fn update_alarm(&self, request: UpdateAlarmRequest) -> Result<()>
Source§impl AudioIn for SonosDevice
impl AudioIn for SonosDevice
async fn get_audio_input_attributes( &self, ) -> Result<GetAudioInputAttributesResponse>
async fn get_line_in_level(&self) -> Result<GetLineInLevelResponse>
async fn select_audio(&self, request: SelectAudioRequest) -> Result<()>
async fn set_audio_input_attributes( &self, request: SetAudioInputAttributesRequest, ) -> Result<()>
async fn set_line_in_level(&self, request: SetLineInLevelRequest) -> Result<()>
async fn start_transmission_to_group( &self, request: StartTransmissionToGroupRequest, ) -> Result<StartTransmissionToGroupResponse>
async fn stop_transmission_to_group( &self, request: StopTransmissionToGroupRequest, ) -> Result<()>
Source§impl Clone for SonosDevice
impl Clone for SonosDevice
Source§fn clone(&self) -> SonosDevice
fn clone(&self) -> SonosDevice
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ConnectionManager for SonosDevice
impl ConnectionManager for SonosDevice
async fn get_current_connection_ids( &self, ) -> Result<GetCurrentConnectionIdsResponse>
async fn get_current_connection_info( &self, request: GetCurrentConnectionInfoRequest, ) -> Result<GetCurrentConnectionInfoResponse>
async fn get_protocol_info(&self) -> Result<GetProtocolInfoResponse>
Source§impl ContentDirectory for SonosDevice
impl ContentDirectory for SonosDevice
Source§async fn browse(&self, request: BrowseRequest) -> Result<BrowseResponse>
async fn browse(&self, request: BrowseRequest) -> Result<BrowseResponse>
TotalMatches and - if necessary - do additional requests with higher StartingIndex. In case of duplicates only the first is returned! Example: albums with same title, even if artists are differentasync fn create_object( &self, request: CreateObjectRequest, ) -> Result<CreateObjectResponse>
async fn destroy_object(&self, request: DestroyObjectRequest) -> Result<()>
async fn find_prefix( &self, request: FindPrefixRequest, ) -> Result<FindPrefixResponse>
Source§async fn get_album_artist_display_option(
&self,
) -> Result<GetAlbumArtistDisplayOptionResponse>
async fn get_album_artist_display_option( &self, ) -> Result<GetAlbumArtistDisplayOptionResponse>
WMP, ITUNES or NONE