Skip to content

Release 0.9.0

Compare
Choose a tag to compare
@andrewsayre andrewsayre released this 06 Jan 23:40
· 66 commits to main since this release
ea86b51

What's Changed

Fixed

  • url is no longer quoted in play_url

New

General

  • Python 3.13 support
  • Updates for HEOS CLI 1.21

const module:

  • MediaType added to represent media types.
  • RepeatType added to represent repeat options.
  • AddCriteriaType added to represent queue add criteria.
  • PlayState added to represent play state.
  • MUSIC_SOURCE_CONNCECT for Tidal/Sonos connect
  • INPUT_SOURCE_1 through INPUT_SOURCE_18

media module:

  • New class Media represents a common base-type for music sources and media items.
  • MediaMusicSource represents a root-level music source, returned from Heos.get_music_sources and includes function browse to enumerate child items.
  • MediaItem represents non-root sources, and all other media types (containers, playlists, albums, stations, etc...). Function browse is used to enumerate child items when browsable=True
  • BrowseResult represents the result of a browse operation and includes the items returned as well as record count information.

Heos class:

  • New update_credential parameter to sign_in and sign_out to indicate that the set credential should be updated and used on a reconnect attempt. Defaults to True.
  • current_credentials property exposes the currently stored credentials, whether passed in through options, or updated as the result of a sign_in or sign_out call.
  • browse for browsing media item by identifiers.
  • browse_media for browsing a MediaMusicSource or MediaItem.
  • play_media for playing an instance of MediaItem. This function will call the correct underlying function to switch the input, play the stream, or add the item to the queue.
  • play_input_source to play an specific input source.
  • play_station to play a station
  • play_preset_station to play a favorite
  • play_url to play a URL
  • add_to_queue to add an item to the queue
  • reboot to reboot the connected device.
  • add_on_controller_event, add_on_heos_event, add_on_connected, add_on_disconnected, add_on_user_credentials_invalid for connecting event handlers.

MediaItem class:

  • play_media for playing the current item on a player. This function will call the correct underlying function to switch the input, play the stream, or add the item to the queue.

HeosPlayer class:

  • add_to_queue to add an item to the player queue
  • play_media for playing an instance of MediaItem. This function will call the correct underlying function to switch the input, play the stream, or add the item to the queue.
  • add_on_player_event for connecting event handlers

Breaking changes

The following items were changed or removed in the library and may represent a breaking change, depending on usage.

const module:

  • SOURCE_CONTROLS now uses enum values from const.MediaType instead of discrete music source constants.
  • Removed music source constants: TYPE_MUSIC_SERVICE, TYPE_STATION, TYPE_SONG, TYPE_HEOS_SERVICE, TYPE_PLAYLIST. Use const.MediaType instead.
  • Removed repeat constants: REPEAT_ON_ALL, REPEAT_ON_ONE, REPEAT_OFF, VALID_REPEAT_MODES. Use const.RepeatType instead.
  • Removed queue criteria constants: ADD_QUEUE_PLAY_NOW, ADD_QUEUE_PLAY_NEXT, ADD_QUEUE_ADD_TO_END, ADD_QUEUE_REPLACE_AND_PLAY, and VALID_ADD_QUEUE_OPTIONS. Use the new enum AddCriteriaType.
  • Removed player state constants: PLAY_STATE_PLAY, PLAY_STATE_PAUSE, PLAY_STATE_STOP, and VALID_PLAY_STATES. Use the new enum PlayState.

Heos class:

  • get_music_sources now returns dict[int, MediaMusicSource]
  • get_input_sources now returns Sequence[MediaItem]
  • get_favorites now returns dict[int, MediaItem]
  • get_playlists now returns Sequence[MediaItem]
  • music_sources now returns dict[int, MediaMusicSource]

HeosPlayer class:

  • set_play_mode method parameter repeat is now of type const.RepeatType
  • play_input_source method parameter input_source is now of type MediaItem
  • add_to_queue method parameter source renamed to media: MediaItem
  • repeat property is now of type const.RepeatType
  • Renamed play_input to play_input_source for consistency.
  • Renamed play_favorite to play_preset_station for consistency.

source module:

This entire module has been removed. The functionality has been replaced by the media module. In most cases, this represents a change to the class only -- property name and functions remain the same from their former counterparts.

  • Removed HeosSource. Root level music sources are now represented by MediaMusicSource. All other source and media types are now represented by MediaItem
  • Removed InputSource. Now represented by MediaItem.

Detailed changes

New Contributors

Full Changelog: 0.8.0...0.9.0