2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-17 05:16:02 +00:00

37_Spotify: new readings

git-svn-id: https://svn.fhem.de/fhem/trunk@14987 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
neumann 2017-09-02 13:14:37 +00:00
parent 7698bc0a64
commit 5840efa6c3
2 changed files with 3 additions and 0 deletions

View File

@ -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

View File

@ -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;