mirror of
https://github.com/fhem/fhem-mirror.git
synced 2024-11-22 09:49:50 +00:00
add: userExtentions
git-svn-id: https://svn.fhem.de/fhem/trunk@26359 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
89f4413274
commit
4d00e2c973
@ -25,7 +25,7 @@ package main;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use List::Util qw[min max];
|
||||
#use List::Util qw[min max];
|
||||
use Data::Dumper;
|
||||
|
||||
#####################################
|
||||
@ -49,7 +49,7 @@ sub dev_proxy_Initialize($) {
|
||||
$hash->{NotifyFn} = "dev_proxy_Notify";
|
||||
$hash->{SetFn} = "dev_proxy_Set";
|
||||
$hash->{AttrFn} = "dev_proxy_Attr";
|
||||
$hash->{AttrList} = "observedReadings setList mapValues mapReadings ". "disable disabledForIntervals ". $readingFnAttributes;
|
||||
$hash->{AttrList} = "observedReadings setList:textField-long mapValues:textField-long mapReadings:textField-long ". "disable disabledForIntervals useSetExtensions ". $readingFnAttributes;
|
||||
|
||||
}
|
||||
|
||||
@ -257,8 +257,8 @@ sub dev_proxy_computeCombReading($$) {
|
||||
return join(" ", keys %{ $tm });
|
||||
}
|
||||
|
||||
my $maxV = max(@values);
|
||||
my $minV = min(@values);
|
||||
my $maxV = List::Util::max(@values);
|
||||
my $minV = List::Util::min(@values);
|
||||
#if($maxV-$minV<10) {
|
||||
return $minV+($maxV-$minV)/2;
|
||||
#}
|
||||
@ -354,13 +354,32 @@ sub dev_proxy_Set($@){
|
||||
$setList.=" ";
|
||||
}
|
||||
}
|
||||
$setList =~ s/\n/ /g;
|
||||
return "Unknown argument $command, choose one of $setList";
|
||||
$setList =~ s/\n/ /g;
|
||||
if(AttrVal($name,"useSetExtensions",undef)) {
|
||||
return SetExtensions($hash, $setList, $name, $command, @values);
|
||||
} else {
|
||||
return "Unknown argument $command, choose one of $setList";
|
||||
}
|
||||
}
|
||||
|
||||
if (AttrVal($name,"useSetExtensions",undef)) {
|
||||
if ($command =~ m/^(blink|intervals|(off-|on-)(for-timer|till)|toggle)/) {
|
||||
Log3($hash->{NAME},5,"calling SetExtensions(...) for $command");
|
||||
my $setList = AttrVal($name, "setList", undef);
|
||||
return SetExtensions($hash, $setList, $name, $command, @values);
|
||||
}
|
||||
}
|
||||
|
||||
if(int(@values)>0 && !defined($hash->{READINGS}->{$command})) {
|
||||
return "Unknown reading $command";
|
||||
if(AttrVal($name,"useSetExtensions",undef)) {
|
||||
my $setList = AttrVal($name, "setList", undef);
|
||||
return SetExtensions($hash, $setList, $name, $command, @values);
|
||||
} else {
|
||||
return "Unknown reading $command";
|
||||
}
|
||||
}
|
||||
|
||||
SetExtensionsCancel($hash);
|
||||
|
||||
my $ret;
|
||||
my @devList = keys %{$hash->{CONTENT}};
|
||||
@ -557,7 +576,7 @@ sub dev_proxy_cleanup_readings($) {
|
||||
<br>
|
||||
</li><br>
|
||||
<li>
|
||||
mapValues: Erlaubt Änderungen/Umrechnungen an den Werte der Readings
|
||||
mapValues: Erlaubt Änderungen/Umrechnungen an den Werten der Readings
|
||||
ggf. abhängig von den jeweiligen Device- und Readingsnamen.
|
||||
Umrechnungstabellen können je nach Richtung ('in' aus Notify oder 'out' für set) getrennt definiert werden.
|
||||
Falls die Definition mit dem Richtungsprefix nicht existiert oder kein Ergebnis liefert,
|
||||
@ -589,6 +608,11 @@ sub dev_proxy_cleanup_readings($) {
|
||||
<br>
|
||||
Beispiel: <br>
|
||||
<code>attr <name> mapReadings Rollo1:pct:position Rollo2:pct:position</code>
|
||||
</li><br>
|
||||
<li>
|
||||
useSetExtensions: bestimmt, ob <a href="#setExtensions">set extensions</a> unterstützt werden. Mögliche Werte: 0,1
|
||||
<br>Beispiel: <br>
|
||||
<p><code>attr <name> useSetExtensions <flags></code><br/>
|
||||
</li>
|
||||
</ul>
|
||||
<br>
|
||||
|
Loading…
Reference in New Issue
Block a user