mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-12 02:39:57 +00:00
fhem.pl: Add userattr for signle devices.
git-svn-id: https://svn.fhem.de/fhem/trunk@6632 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
bd58157c4e
commit
31dc910625
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||||
# Do not insert empty lines here, update check depends on it.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- feature: userattr is now also device attribute
|
||||||
- feature: ZWave: Fibaro_FGRM222 MANUFACTURER_PROPRIETARY class
|
- feature: ZWave: Fibaro_FGRM222 MANUFACTURER_PROPRIETARY class
|
||||||
- feature: sequence: reportEvents attribtue added
|
- feature: sequence: reportEvents attribtue added
|
||||||
- feature: SYSMON: RAM and SWAP Readings on OSX
|
- feature: SYSMON: RAM and SWAP Readings on OSX
|
||||||
|
@ -1255,8 +1255,10 @@ A line ending with \ will be concatenated with the next one, so long lines
|
|||||||
<a name="userattr"></a>
|
<a name="userattr"></a>
|
||||||
<li>userattr<br>
|
<li>userattr<br>
|
||||||
A space separated list which contains the names of additional
|
A space separated list which contains the names of additional
|
||||||
attributes. Without specifying them you will not be able to set them
|
attributes for all devices. Without specifying them you will not be
|
||||||
(in order to prevent typos).
|
able to set them (in order to prevent typos).<br>
|
||||||
|
userattr can also specified for other devices, in this case
|
||||||
|
these additinal attribute names are only valid for this device.
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
<a name="dupTimeout"></a>
|
<a name="dupTimeout"></a>
|
||||||
|
@ -1346,9 +1346,12 @@ Zeilen erstreckende Befehle, indem man keine \ am Zeilenende eingeben muss.</p>
|
|||||||
|
|
||||||
<a name="userattr"></a>
|
<a name="userattr"></a>
|
||||||
<li>userattr<br>
|
<li>userattr<br>
|
||||||
Enthält eine durch Leerzeichen getrennte Liste in welcher die Namen
|
Enthält eine durch Leerzeichen getrennte Liste in welcher die
|
||||||
zusätzlicher Attribute aufgeführt sind. Diese müssen zuerst in dieser Liste
|
Namen zusätzlicher Attribute aufgeführt sind. Diese
|
||||||
definiert werden, bevor sie angewendet werden können.
|
müssen zuerst in dieser Liste definiert werden, bevor sie
|
||||||
|
(bei allen Geräten) angewendet werden können.<br>
|
||||||
|
userattr kann auch für einzelne Geräte spezifiziert werden,
|
||||||
|
um weitere Attribute für diese Geräte zu definieren.
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
<a name="dupTimeout"></a>
|
<a name="dupTimeout"></a>
|
||||||
|
12
fhem/fhem.pl
12
fhem/fhem.pl
@ -240,7 +240,7 @@ $modules{Global}{ORDER} = -1;
|
|||||||
$modules{Global}{LOADED} = 1;
|
$modules{Global}{LOADED} = 1;
|
||||||
$modules{Global}{AttrList} =
|
$modules{Global}{AttrList} =
|
||||||
"archivecmd apiversion archivedir configfile lastinclude logfile " .
|
"archivecmd apiversion archivedir configfile lastinclude logfile " .
|
||||||
"modpath nrarchive pidfilename port statefile title userattr " .
|
"modpath nrarchive pidfilename port statefile title " .
|
||||||
"mseclog:1,0 version nofork:1,0 logdir holiday2we " .
|
"mseclog:1,0 version nofork:1,0 logdir holiday2we " .
|
||||||
"autoload_undefined_devices:1,0 dupTimeout latitude longitude altitude " .
|
"autoload_undefined_devices:1,0 dupTimeout latitude longitude altitude " .
|
||||||
"backupcmd backupdir backupsymlink backup_before_update " .
|
"backupcmd backupdir backupsymlink backup_before_update " .
|
||||||
@ -1361,7 +1361,12 @@ CommandSave($$)
|
|||||||
print $fh "define $d $defs{$d}{TYPE}\n";
|
print $fh "define $d $defs{$d}{TYPE}\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach my $a (sort keys %{$attr{$d}}) {
|
|
||||||
|
foreach my $a (sort {
|
||||||
|
return -1 if($a eq "userattr"); # userattr must be first
|
||||||
|
return 1 if($b eq "userattr");
|
||||||
|
return $a cmp $b;
|
||||||
|
} keys %{$attr{$d}}) {
|
||||||
next if($d eq "global" &&
|
next if($d eq "global" &&
|
||||||
($a eq "configfile" || $a eq "version"));
|
($a eq "configfile" || $a eq "version"));
|
||||||
my $val = $attr{$d}{$a};
|
my $val = $attr{$d}{$a};
|
||||||
@ -2062,6 +2067,9 @@ getAllAttr($)
|
|||||||
if($modules{$defs{$d}{TYPE}}{AttrList});
|
if($modules{$defs{$d}{TYPE}}{AttrList});
|
||||||
$list .= " " . $attr{global}{userattr}
|
$list .= " " . $attr{global}{userattr}
|
||||||
if($attr{global}{userattr});
|
if($attr{global}{userattr});
|
||||||
|
$list .= " " . $attr{$d}{userattr}
|
||||||
|
if($attr{$d} && $attr{$d}{userattr});
|
||||||
|
$list .= " userattr";
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user