11_OWDevice: new attribute disable (forum #122563)
git-svn-id: https://svn.fhem.de/fhem/trunk@24870 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# 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.
|
||||
- feature: 11_OWDevice: new attribute disable (forum #122563)
|
||||
- change: 50_TelegramBot: parseMode for Photo & Video / FIX: 0_none logmode
|
||||
- feature: 19_Revolt: add standard attributes ignore, showtime etc.
|
||||
- feature: 23_LUXTRONIK2: new set parameter ventBOSUPCircPumpDeaerate
|
||||
|
||||
@@ -383,7 +383,7 @@ OWDevice_Initialize($)
|
||||
$hash->{UndefFn} = "OWDevice_Undef";
|
||||
$hash->{AttrFn} = "OWDevice_Attr";
|
||||
|
||||
$hash->{AttrList} = "IODev uncached trimvalues polls interfaces model cstrings ".
|
||||
$hash->{AttrList} = "IODev uncached trimvalues polls interfaces model cstrings disable:0,1 ".
|
||||
"resolution:9,10,11,12 ".
|
||||
$readingFnAttributes;
|
||||
}
|
||||
@@ -506,6 +506,9 @@ OWDevice_UpdateValues($) {
|
||||
|
||||
my ($hash)= @_;
|
||||
|
||||
my $name= $hash->{NAME};
|
||||
return if (AttrVal($name, 'disable', 0) == 1);
|
||||
|
||||
my @polls= @{$hash->{fhem}{polls}};
|
||||
my @getters= @{$hash->{fhem}{getters}};
|
||||
my @state= @{$hash->{fhem}{state}};
|
||||
@@ -577,7 +580,12 @@ OWDevice_Attr($@)
|
||||
delete $hash->{fhem}{interfaces} if(defined($hash->{fhem}{interfaces}));
|
||||
Log3 $name, 5, "$name: no interfaces";
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif($attrName eq "disable" && ($cmd eq 'del' || $attrVal == 0)) { # restart after disable
|
||||
RemoveInternalTimer($hash);
|
||||
InternalTimer(int(gettimeofday()) + $hash->{fhem}{interval}, "OWDevice_UpdateValues", $hash, 0)
|
||||
if(defined($hash->{fhem}{interval}));
|
||||
}
|
||||
}
|
||||
|
||||
###################################
|
||||
@@ -714,7 +722,7 @@ OWDevice_Notify($$)
|
||||
return if($dev->{NAME} ne "global");
|
||||
return if(!grep(m/^INITIALIZED|REREADCFG$/, @{$dev->{CHANGED}}));
|
||||
|
||||
return if($attr{$name} && $attr{$name}{disable});
|
||||
return if($attr{$name} && $attr{$name}{disable} == 1);
|
||||
|
||||
OWDevice_InitValues($hash);
|
||||
RemoveInternalTimer($hash);
|
||||
@@ -908,6 +916,7 @@ OWDevice_InitValues($)
|
||||
<li>trimvalues: removes leading and trailing whitespace from readings. Default is 1 (on).</li>
|
||||
<li>cstrings: interprets reading as C-style string, i.e. stops reading on the first zero byte. Default is 0 (off).</li>
|
||||
<li>polls: a comma-separated list of readings to poll. This supersedes the list of default readings to poll.</li>
|
||||
<li>disable: set to 1 to disable polling.</li>
|
||||
<li>interfaces: supersedes the interfaces exposed by that device.</li>
|
||||
<li>model: preset with device type, e.g. DS18S20.</li>
|
||||
<li>resolution: resolution of temperature reading in bits, can be 9, 10, 11 or 12.
|
||||
@@ -1071,6 +1080,7 @@ OWDevice_InitValues($)
|
||||
<li>trimvalues: Entfernt voran- und nachgestellte Leerzeichen aus den readings. Standartwert ist 1 (ein).</li>
|
||||
<li>cstrings: Interpretiert die readings als C-String, d.h. hört mit dem ersten 0-Byte zu lesen auf. Standardwert ist 0 (off).</li>
|
||||
<li>polls: Eine per Komma getrennte Liste der abzurufenden readings. Mit diesem Attribut unterdrückt man alle standartmäßig abgerufenen readings und ersetzt sie durch die eigene Zusammenstellung.</li>
|
||||
<li>disable: auf 1 setzen, um Polling abzustellen.</li>
|
||||
<li>interfaces: Ersetzt die durch dieses Gerät erzeugten Interfaces.</li>
|
||||
<li>model: Angabe des Gerätetyps, z.B.: DS18S20.</li>
|
||||
<li>resolution: Angabe der Auflösung für die Temperaturmessung in bits, zur Verfügung stehen: 9, 10, 11 oder 12.
|
||||
|
||||
Reference in New Issue
Block a user