2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

01_FHEMWEB.pm: revert FW_widgetFallbackFn changed (Forum #136049)

git-svn-id: https://svn.fhem.de/fhem/trunk@28235 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2023-12-02 09:34:43 +00:00
parent 34017567bb
commit 06e8a926df

View File

@ -3612,25 +3612,22 @@ FW_widgetFallbackFn()
# noArg is needed for fhem.cfg.demo / Cinema
return "" if(!$values || $values eq "noArg");
my $reading;
($cmd, $reading) = split(' ', $cmd, 2) if($values !~ m/^colorpicker,/);
$reading = $cmd if(!defined($reading));
my($source) = split(' ', $cmd, 2); # cmd part only, #136049
my $current;
if($cmd eq "desired-temp" || $cmd eq "desiredTemperature") {
$current = ReadingsVal($d, $cmd, 20);
$current =~ s/ .*//; # Cut off Celsius
$current = sprintf("%2.1f", int(2*$current)/2) if($current =~ m/[0-9.-]/);
} else {
$current = ReadingsVal($d, $reading, undef);
$current = ReadingsVal($d, $source, undef);
if( !defined($current) ) {
$reading = 'state';
$source = 'state';
$current = Value($d);
}
$current =~ s/$cmd //;
$current = ReplaceEventMap($d, $current, 1);
}
return "<td><div class='fhemWidget' cmd='$cmd' reading='$reading' ".
return "<td><div class='fhemWidget' cmd='$cmd' reading='$source' ".
"dev='$d' arg='$values' current='$current'></div></td>";
}
# Widgets END