From 6e7a94f52708c1e5920b120ef8eb4d0fff715604 Mon Sep 17 00:00:00 2001 From: "michael.winkler" <> Date: Mon, 27 Apr 2020 07:59:59 +0000 Subject: [PATCH] 37_echodevice.pm: bugfixes git-svn-id: https://svn.fhem.de/fhem/trunk@21788 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/37_echodevice.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/37_echodevice.pm b/fhem/FHEM/37_echodevice.pm index bc90f6c5e..c27c4e655 100644 --- a/fhem/FHEM/37_echodevice.pm +++ b/fhem/FHEM/37_echodevice.pm @@ -2,8 +2,9 @@ # ############################################## # -# 2020.04.27 v0.1.6 +# 2020.04.27 v0.1.7 # - FEATURE: Unterstützung A1WAR447VT003J Yamaha MusicCast 20 +# - BUG: set "NPM_login refresh" # - CHANGE: get status erweitert # # 2020.04.22 v0.1.5 @@ -388,7 +389,7 @@ use Time::Piece; use lib ('./FHEM/lib', './lib'); use MP3::Info; -my $ModulVersion = "0.1.6"; +my $ModulVersion = "0.1.7"; my $AWSPythonVersion = "0.0.3"; my $NPMLoginTyp = "unbekannt"; @@ -4817,6 +4818,7 @@ sub echodevice_NPMWaitForCookie($){ my $filename = "cache/alexa-cookie/" . $number . "result.json"; my $CanDelete = 0; my $ExistSkript = "false"; + my $CookieResult; if ($NPMLoginTyp =~ m/Refresh/) { $ExistSkript = $number . "refresh-cookie.js = true" if (-e "cache/alexa-cookie/" . $number . "refresh-cookie.js"); @@ -4830,12 +4832,14 @@ sub echodevice_NPMWaitForCookie($){ open(MAILDAT, "<$filename") || die "Datei wurde nicht gefunden\n"; while(){ if (index($_, "{") != -1) { + $CookieResult = $_; Log3 $name, 3, "[$name] [echodevice_NPMWaitForCookie] [$NPMLoginTyp] write new refreshtoken"; + Log3 $name, 3, "[$name] [echodevice_NPMWaitForCookie] [$NPMLoginTyp] $CookieResult"; readingsSingleUpdate( $hash, "amazon_refreshtoken", "vorhanden",1 ); - readingsSingleUpdate( $hash, ".COOKIE", $_,1 ); + readingsSingleUpdate( $hash, ".COOKIE", $CookieResult,1 ); readingsSingleUpdate( $hash, "COOKIE_TYPE", "NPM_Login",1 ); - $hash->{helper}{".COOKIE"} = $_; + $hash->{helper}{".COOKIE"} = $CookieResult; $hash->{helper}{".COOKIE"} =~ /"localCookie":".*session-id=(.*)","?/; $hash->{helper}{".COOKIE"} = "session-id=" . $1; $hash->{helper}{".COOKIE"} =~ /csrf=([-\w]+)[;\s]?(.*)?$/ if(defined($hash->{helper}{".COOKIE"}));