2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-29 17:37:09 +00:00

CUL_HM: aviod error if HMinfo is not defined

git-svn-id: https://svn.fhem.de/fhem/trunk@25287 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2021-12-03 17:35:39 +00:00
parent 6a6139be91
commit da7dc81546

View File

@ -5478,7 +5478,9 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
elsif($cmd eq "tplDel") { ################################################### elsif($cmd eq "tplDel") { ###################################################
return "template missing" if (!defined $a[2]); return "template missing" if (!defined $a[2]);
my ($p,$t) = split(">",$a[2]); my ($p,$t) = split(">",$a[2]);
if (defined &HMinfo_templateDel){
HMinfo_templateDel($name,$t,$p) if (eval "defined(&HMinfo_templateDel)"); HMinfo_templateDel($name,$t,$p) if (eval "defined(&HMinfo_templateDel)");
}
return; return;
} }
elsif($cmd eq "virtual") { ################################################## elsif($cmd eq "virtual") { ##################################################
@ -7519,7 +7521,10 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
return "no HMinfo defined" if (!defined $defs{$hm}); return "no HMinfo defined" if (!defined $defs{$hm});
my @par = map{$params{$_}} sort keys%params; my @par = map{$params{$_}} sort keys%params;
my $ret = HMinfo_SetFn($defs{$hm},$hm,"templateSet",$name,$tpl,"$tPeer$tTyp",@par); my $ret = "not supported w/o HMinfo";
if (defined &HMinfo_SetFn){
$ret = HMinfo_SetFn($defs{$hm},$hm,"templateSet",$name,$tpl,"$tPeer$tTyp",@par);
}
return $ret; return $ret;
} }
elsif($cmd =~ m/tplPara(..)(.)_.*/) { ####################################### elsif($cmd =~ m/tplPara(..)(.)_.*/) { #######################################
@ -7538,7 +7543,10 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
$pv[$pNo] = $a[2]; $pv[$pNo] = $a[2];
} }
my $ret = HMinfo_SetFn($defs{hm},$hm,"templateSet",$name,$tn,$p,@pv); my $ret = "not supported w/o HMinfo";
if (defined &HMinfo_SetFn){
$ret = HMinfo_SetFn($defs{hm},$hm,"templateSet",$name,$tn,$p,@pv);
}
return $ret; return $ret;
} }