From b03665e178be760b8af7b3133c7bbe2fe945daeb Mon Sep 17 00:00:00 2001 From: fhemrocks Date: Wed, 23 Jul 2014 11:29:30 +0000 Subject: [PATCH] selected playlist now stored and displayed git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@6310 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/98_SB_PLAYER.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fhem/contrib/98_SB_PLAYER.pm b/fhem/contrib/98_SB_PLAYER.pm index 77f0beb60..eb21a9eef 100644 --- a/fhem/contrib/98_SB_PLAYER.pm +++ b/fhem/contrib/98_SB_PLAYER.pm @@ -332,6 +332,11 @@ sub SB_PLAYER_Define( $$ ) { $hash->{READINGS}{favorites}{TIME} = $tn; } + if( !defined( $hash->{READINGS}{playlists}{VAL} ) ) { + $hash->{READINGS}{playlists}{VAL} = "not"; + $hash->{READINGS}{playlists}{TIME} = $tn; + } + # for the FHEM AV Development Guidelinses # we use this to store the currently playing ID to later on return to if( !defined( $hash->{READINGS}{currentMedia}{VAL} ) ) { @@ -1240,6 +1245,7 @@ sub SB_PLAYER_Set( $@ ) { Log3( $hash, 5, "SB_PLAYER_Set($name): playlists command = " . $msg . " ........ with $arg[0]" ); IOWrite( $hash, $msg . "\n" ); + readingsSingleUpdate( $hash, "playlists", "$arg[ 0 ]", 1 ); SB_PLAYER_GetStatus( $hash ); } else {