2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 16:59:18 +00:00

HMInfo:correct templistconfig setting

git-svn-id: https://svn.fhem.de/fhem/trunk@16225 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2018-02-19 19:23:47 +00:00
parent 5737a38dc6
commit 9a1d33d6ea

View File

@ -898,13 +898,15 @@ sub HMinfo_tempListDefFn(@) { #################################################
my ($fn) = shift;
$fn = "" if (!defined $fn);
my $ret = "";
my ($n) = devspec2array("TYPE=HMinfo");
$ret .= "$attr{global}{modpath}/" if ( !$fn || $fn !~ m/^\//); #no path? add modpath
$ret .= AttrVal($n,"configDir",".")."/" if ( !$ret || $ret !~ m/..*\//
&& (!$fn || $fn !~ m/^\//));#no dir? add defDir
if (!$fn){ #set filename
my ($f) = split(",",AttrVal($n,"configTempFile","tempList.cfg"));
$ret .= $f;
if($fn !~ m/\//){ # filename already with path - dont change
my ($n) = devspec2array("TYPE=HMinfo");
$ret .= AttrVal($n,"configDir",".")."/" if ( !$fn || $fn !~ m/^\//);#no dir? add defDir
$ret = AttrVal("global","modpath",".")."/$ret" if ( !$ret || $ret !~ m/^\//);#no path? add modpath
if (!$fn){ #set filename
my ($f) = split(",",AttrVal($n,"configTempFile","tempList.cfg"));
$ret .= $f;
}
}
return $ret.$fn;
}