Skip to content

Commit

Permalink
[ 1.0.44 ] * Added extra state variable: `soundtouchplus_websockets_e…
Browse files Browse the repository at this point in the history
…nabled`. Returns true if websocket support is enabled for the device; otherwise, false if device does not support websockets or if websockets were disabled during device setup.

  * Added extra state variable: `soundtouchplus_polling_enabled`.  Returns true if device polling is enabled; otherwise, false.  Polling can be a temporary condition, in that it will be enabled if websocket support is enabled and the connection is lost and has not been re-established yet.
  • Loading branch information
thlucas1 committed May 21, 2024
1 parent 5a2a5b3 commit 5805245
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Change are listed in reverse chronological order (newest to oldest).

<span class="changelog">

###### [ 1.0.44 ] - 2024/05/21

* Added extra state variable: `soundtouchplus_websockets_enabled`. Returns true if websocket support is enabled for the device; otherwise, false if device does not support websockets or if websockets were disabled during device setup.
* Added extra state variable: `soundtouchplus_polling_enabled`. Returns true if device polling is enabled; otherwise, false. Polling can be a temporary condition, in that it will be enabled if websocket support is enabled and the connection is lost and has not been re-established yet.

###### [ 1.0.43 ] - 2024/05/20

* Added extra state variables related to recently played cache feature: `soundtouchplus_recents_cache_enabled`, `soundtouchplus_recents_cache_max_items`, `soundtouchplus_recents_cache_lastupdated`.
Expand Down
2 changes: 1 addition & 1 deletion custom_components/soundtouchplus/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"smartinspectPython>=3.0.33",
"spotifywebapiPython==1.0.43"
],
"version": "1.0.43",
"version": "1.0.44",
"zeroconf": [ "_soundtouch._tcp.local." ]
}
4 changes: 4 additions & 0 deletions custom_components/soundtouchplus/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
ATTR_SOUNDTOUCHPLUS_TONE_BASS_LEVEL_RANGE = "soundtouchplus_tone_bass_level_range"
ATTR_SOUNDTOUCHPLUS_TONE_TREBLE_LEVEL = "soundtouchplus_tone_treble_level"
ATTR_SOUNDTOUCHPLUS_TONE_TREBLE_LEVEL_RANGE = "soundtouchplus_tone_treble_level_range"
ATTR_SOUNDTOUCHPLUS_WEBSOCKETS_ENABLED = "soundtouchplus_websockets_enabled"
ATTR_SOUNDTOUCHPLUS_POLLING_ENABLED = "soundtouchplus_polling_enabled"
ATTRVALUE_NOT_CAPABLE = "not capable"


Expand Down Expand Up @@ -293,6 +295,8 @@ def extra_state_attributes(self):
attributes[ATTR_SOUNDTOUCHPLUS_SOURCE] = self.soundtouchplus_source
attributes[ATTR_SOUNDTOUCHPLUS_RECENTS_CACHE_ENABLED] = self._client.RecentListCacheEnabled
attributes[ATTR_SOUNDTOUCHPLUS_RECENTS_CACHE_MAX_ITEMS] = self._client.RecentListCacheMaxItems
attributes[ATTR_SOUNDTOUCHPLUS_WEBSOCKETS_ENABLED] = (self._socket is not None)
attributes[ATTR_SOUNDTOUCHPLUS_POLLING_ENABLED] = (self._attr_should_poll)

if SoundTouchNodes.audiodspcontrols.Path in self._client.ConfigurationCache:
config:AudioDspControls = self._client.ConfigurationCache[SoundTouchNodes.audiodspcontrols.Path]
Expand Down

0 comments on commit 5805245

Please sign in to comment.