2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

fhem.pl: allow STATE with space/tab in it (Forum #61566)

git-svn-id: https://svn.fhem.de/fhem/trunk@12955 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-01-04 15:33:06 +00:00
parent 156bb2fe09
commit 27f389ab44

View File

@ -1384,6 +1384,7 @@ GetAllReadings($)
$val ne "" &&
$val ne "???") {
$val =~ s/;/;;/g;
$val =~ s/([ \t])/sprintf("\\%03o",ord($1))/eg if($val =~ m/^[ \t]*$/);
$val =~ s/\n/\\\n/g;
push @ret, "setstate $d $val";
}
@ -2748,6 +2749,7 @@ CommandSetstate($$)
# The timestamp is not the correct one, but we do not store a timestamp
# for this reading.
my $tn = TimeNow();
$a[1] =~ s/\\(...)/chr(oct($1))/ge if($a[1] =~ m/^(\\011|\\040)+$/);
$oldvalue{$sdev}{TIME} = $tn;
$oldvalue{$sdev}{VAL} = ($init_done ? $d->{STATE} : $a[1]);