mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-15 22:26:04 +00:00
fhem.pl: fixing change history (Forum #32296)
git-svn-id: https://svn.fhem.de/fhem/trunk@7689 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
aab0aedc60
commit
5356c644fb
10
fhem/fhem.pl
10
fhem/fhem.pl
@ -2317,6 +2317,7 @@ CommandAttr($$)
|
||||
}
|
||||
|
||||
$a[0] = $sdev;
|
||||
my $oVal = ($attr{$sdev} ? $attr{$sdev}{$attrName} : "");
|
||||
$ret = CallFn($sdev, "AttrFn", "set", @a);
|
||||
if($ret) {
|
||||
push @rets, $ret;
|
||||
@ -2325,12 +2326,6 @@ CommandAttr($$)
|
||||
|
||||
my $val = $a[2];
|
||||
$val = 1 if(!defined($val));
|
||||
|
||||
addStructChange("attr", $sdev, $param)
|
||||
if(!($attr{$sdev} &&
|
||||
defined($attr{$sdev}{$attrName}) &&
|
||||
$attr{$sdev}{$attrName} eq $val));
|
||||
|
||||
$attr{$sdev}{$attrName} = $val;
|
||||
|
||||
if($attrName eq "IODev") {
|
||||
@ -2343,6 +2338,7 @@ CommandAttr($$)
|
||||
if($attrName eq "stateFormat" && $init_done) {
|
||||
evalStateFormat($hash);
|
||||
}
|
||||
addStructChange("attr", $sdev, $param) if(!defined($oVal) || $oVal ne $val);
|
||||
DoTrigger("global", "ATTR $sdev $attrName $val", 1) if($init_done);
|
||||
|
||||
}
|
||||
@ -4088,7 +4084,7 @@ addStructChange($$$)
|
||||
return if(!$defs{$dev} || $defs{$dev}{TEMPORARY});
|
||||
|
||||
$lastDefChange++;
|
||||
shift @structChangeHist if(@structChangeHist > 10);
|
||||
shift @structChangeHist if(@structChangeHist > 9);
|
||||
$param = substr($param, 0, 40)."..." if(length($param) > 40);
|
||||
push @structChangeHist, "$cmd $param";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user