From aaa3864d3e8e0daf27ea70b08560a67d3aa23e4a Mon Sep 17 00:00:00 2001 From: phenning Date: Sat, 10 Mar 2018 09:28:10 +0000 Subject: [PATCH] =?UTF-8?q?95=5FYAAHM.pm:=20Neue=20Version=20mit=20Fix=20f?= =?UTF-8?q?=C3=BCr=20save=2095=5FBabble.pm:=20Neue=20Version=20mit=20Fix?= =?UTF-8?q?=20f=C3=BCr=20save?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.fhem.de/fhem/trunk@16371 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/95_Babble.pm | 13 ++++++------- fhem/FHEM/95_YAAHM.pm | 9 ++++----- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/fhem/FHEM/95_Babble.pm b/fhem/FHEM/95_Babble.pm index 93adf5ac7..908cee38a 100644 --- a/fhem/FHEM/95_Babble.pm +++ b/fhem/FHEM/95_Babble.pm @@ -53,7 +53,7 @@ if (eval {require RiveScript;1;} ne 1) { my $babblelinkname = "babbles"; # link text my $babblehiddenroom = "babbleRoom"; # hidden room my $babblepublicroom = "babble"; # public room -my $babbleversion = "1.31"; +my $babbleversion = "1.32"; my %babble_transtable_EN = ( "ok" => "OK", @@ -439,12 +439,11 @@ sub Babble_Get($@) { sub Babble_save($) { my ($hash) = @_; - my $date = localtime(time); + my $date = TimeNow(); my $name = $hash->{NAME}; $hash->{DATA}{"savedate"} = $date; - readingsSingleUpdate( $hash, "savedate", $hash->{DATA}{"savedate"}, 1 ); - my $json = JSON->new->utf8; - my $jhash0 = eval{ $json->encode( $hash->{DATA} ) }; + readingsSingleUpdate( $hash, "savedate", $date, 1 ); + my $jhash0 = toJSON($hash->{DATA}); if( ReadingsVal($name,"lockstate","locked") ne "locked" ){ my $error = FileWrite("babbleFILE",$jhash0); #Log3 $name, 1, " ".Dumper($jhash0); @@ -1702,7 +1701,7 @@ sub Babble_getplaces($$$) { @{$hash->{DATA}{"places"}} = @places; $hash->{DATA}{"re_places"} = lc("((".join(")|(",@places)."))"); - Babble_save($hash); + #Babble_save($hash); return; #-- just do something with the current list }elsif( $type eq "html" ){ @@ -1845,7 +1844,7 @@ sub Babble_getwords($$$$) { $hash->{DATA}{"re_writes"} = lc("((".join(")|(",@words)."))"); } delete($hash->{DATA}{"pronouns"}); - Babble_save($hash); + #Babble_save($hash); return; #-- just do something with the current list diff --git a/fhem/FHEM/95_YAAHM.pm b/fhem/FHEM/95_YAAHM.pm index 4e53c8310..3c6a678b2 100644 --- a/fhem/FHEM/95_YAAHM.pm +++ b/fhem/FHEM/95_YAAHM.pm @@ -47,7 +47,7 @@ my $yaahmname; my $yaahmlinkname = "Profile"; # link text my $yaahmhiddenroom = "ProfileRoom"; # hidden room my $yaahmpublicroom = "Unsorted"; # public room -my $yaahmversion = "1.49"; +my $yaahmversion = "1.50"; my $firstcall = 1; my %yaahm_transtable_EN = ( @@ -953,11 +953,10 @@ sub YAAHM_Get($@) { sub YAAHM_save($) { my ($hash) = @_; - my $date = localtime(time); + my $date = TimeNow(); $hash->{DATA}{"savedate"} = $date; - readingsSingleUpdate( $hash, "savedate", $hash->{DATA}{"savedate"}, 1 ); - my $json = JSON->new->utf8; - my $jhash0 = eval{ $json->encode( $hash->{DATA} ) }; + readingsSingleUpdate( $hash, "savedate", $date, 1 ); + my $jhash0 = toJSON($hash->{DATA}); my $error = FileWrite("YAAHMFILE",$jhash0); #Log 1,"[YAAHM_save] error=$error"; return;