mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-21 01:46:08 +00:00
allow webCmdFn mapping of webCmd label
git-svn-id: https://svn.fhem.de/fhem/trunk@5067 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
17d6fc13bd
commit
2b449d5f9a
@ -187,6 +187,8 @@ lookup($$$$$$$$)
|
|||||||
$default = $mapping;
|
$default = $mapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $default if( !defined($default) );
|
||||||
|
|
||||||
$default =~ s/\%ALIAS/$alias/g;
|
$default =~ s/\%ALIAS/$alias/g;
|
||||||
$default =~ s/\%DEVICE/$name/g;
|
$default =~ s/\%DEVICE/$name/g;
|
||||||
$default =~ s/\%READING/$reading/g;
|
$default =~ s/\%READING/$reading/g;
|
||||||
@ -454,6 +456,14 @@ readingsGroup_2html($)
|
|||||||
|
|
||||||
if( $htmlTxt =~ m/<td colspan='2'>(.*)<\/td>/s ) {
|
if( $htmlTxt =~ m/<td colspan='2'>(.*)<\/td>/s ) {
|
||||||
$txt = $1;
|
$txt = $1;
|
||||||
|
|
||||||
|
my $a = AttrVal($name, "alias", $name);
|
||||||
|
my $room = AttrVal($name, "room", "");
|
||||||
|
my $group = AttrVal($name, "group", "");
|
||||||
|
my $mapped = lookup($mapping,$name,$a,$set,"",$room,$group,undef);
|
||||||
|
if( defined($mapped) ) {
|
||||||
|
$txt =~ s/$set /$mapped /;
|
||||||
|
}
|
||||||
} elsif( $htmlTxt ) {
|
} elsif( $htmlTxt ) {
|
||||||
$txt = $htmlTxt;
|
$txt = $htmlTxt;
|
||||||
}
|
}
|
||||||
@ -569,6 +579,10 @@ readingsGroup_2html($)
|
|||||||
|
|
||||||
if( $htmlTxt =~ m/<td colspan='2'>(.*)<\/td>/s ) {
|
if( $htmlTxt =~ m/<td colspan='2'>(.*)<\/td>/s ) {
|
||||||
$v = $1;
|
$v = $1;
|
||||||
|
my $mapped = lookup($mapping,$name,$a,$set,"",$room,$group,undef);
|
||||||
|
if( defined($mapped) ) {
|
||||||
|
$v =~ s/$set /$mapped /;
|
||||||
|
}
|
||||||
$webCmdFn = 1;
|
$webCmdFn = 1;
|
||||||
} elsif( $htmlTxt ) {
|
} elsif( $htmlTxt ) {
|
||||||
$v = $htmlTxt;
|
$v = $htmlTxt;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user