2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

fhem.pl: accept multiline readings from the statefile, do no write empty STATE (Forum #60474)

git-svn-id: https://svn.fhem.de/fhem/trunk@12544 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2016-11-11 06:48:16 +00:00
parent fdc442cd24
commit 49414073ff

View File

@ -1358,6 +1358,7 @@ GetAllReadings($)
if(defined($val) &&
$val ne "unknown" &&
$val ne "Initialized" &&
$val ne "" &&
$val ne "???") {
$val =~ s/;/;;/g;
$val =~ s/\n/\\\n/g;
@ -2686,7 +2687,7 @@ CommandSetstate($$)
my $d = $defs{$sdev};
# Detailed state with timestamp
if($a[1] =~ m/^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) +([^ ].*)$/) {
if($a[1] =~ m/^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) +([^ ].*)$/s) {
my ($tim, $nameval) = ($1, $2);
my ($sname, $sval) = split(" ", $nameval, 2);
(undef, $sval) = ReplaceEventMap($sdev, [$sdev, $sval], 0)