diff --git a/fhem/CHANGED b/fhem/CHANGED index 14eb9b64f..8c08309ec 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: 37_Spotify: new readings - new: 93_Log2Syslog: V3.0.0, first release - bugfix: 93_DbRep: V5.6.2, commandref revised - feature: 00_MQTT: OnMessageFn, last-will, onConnect/onDisconnect diff --git a/fhem/FHEM/37_Spotify.pm b/fhem/FHEM/37_Spotify.pm index 290a90d3b..d1817a179 100644 --- a/fhem/FHEM/37_Spotify.pm +++ b/fhem/FHEM/37_Spotify.pm @@ -846,6 +846,7 @@ sub Spotify_dispatch($$$) { readingsBulkUpdateIfChanged($hash, 'shuffle', $json->{shuffle_state} ? 'on' : 'off', 1); readingsBulkUpdateIfChanged($hash, 'repeat', $hash->{helper}{repeat}, 1); readingsBulkUpdateIfChanged($hash, 'progress_ms', $json->{progress_ms}, 1); + readingsBulkUpdateIfChanged($hash, "progress", h2hms_fmt($json->{progress_ms} / 1000 / 60 / 60), 1); if(defined $json->{item}) { my $item = $json->{item}; @@ -927,6 +928,7 @@ sub Spotify_saveTrack($$$$) { # save a track object to the readings readingsBulkUpdateIfChanged($hash, $prefix."_artist_uri", $track->{artists}[0]{uri}, 1); readingsBulkUpdateIfChanged($hash, $prefix."_album_name", $track->{album}{name}, 1); readingsBulkUpdateIfChanged($hash, $prefix."_album_uri", $track->{album}{uri}, 1); + readingsBulkUpdateIfChanged($hash, $prefix."_duration", h2hms_fmt($track->{duration_ms} / 1000 / 60 / 60), 1); my @sizes = ("large", "medium", "small"); my $index = 0;