mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-08 13:24:56 +00:00
added new set command "interval" to OWDevice
git-svn-id: https://svn.fhem.de/fhem/trunk@2560 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
51b19c990c
commit
4de3ed40a2
@ -565,8 +565,18 @@ OWDevice_Set($@)
|
||||
OWDevice_WriteValue($hash,$cmdname,$value);
|
||||
readingsSingleUpdate($hash,$cmdname,$value,1);
|
||||
return undef;
|
||||
} elsif ($cmdname eq "interval") {
|
||||
return "Wrong interval format: Only digits are allowed!"
|
||||
if($value !~ m/^\d+$/);
|
||||
if($value == $hash->{fhem}{interval}) {
|
||||
return "new interval is equal to old interval.";
|
||||
} else {
|
||||
RemoveInternalTimer($hash);
|
||||
$hash->{fhem}{interval}= $value;
|
||||
InternalTimer(int(gettimeofday())+$hash->{fhem}{interval}, "OWDevice_UpdateValues", $hash, 0)
|
||||
}
|
||||
} else {
|
||||
return "Unknown argument $cmdname, choose one of " . join(" ", @setters);
|
||||
return "Unknown argument $cmdname, choose one of interval " . join(" ", @setters);
|
||||
}
|
||||
}
|
||||
|
||||
@ -741,16 +751,21 @@ OWDevice_Define($$)
|
||||
<a name="OWDeviceset"></a>
|
||||
<b>Set</b>
|
||||
<ul>
|
||||
<code>set <name> <reading> <value></code>
|
||||
<br><br>
|
||||
Sets <reading> to <value> for the 1-wire device <name>. The permitted values are defined by the underlying
|
||||
1-wire device type.
|
||||
<br><br>
|
||||
Example:
|
||||
<ul>
|
||||
<code>set myT1 templow 5</code><br>
|
||||
</ul>
|
||||
<br>
|
||||
<li><code>set <name> interval <value></code>
|
||||
<br><br>
|
||||
<code>value</code> modifies the interval for polling data. The unit is in seconds.
|
||||
</li>
|
||||
<li><code>set <name> <reading> <value></code>
|
||||
<br><br>
|
||||
Sets <reading> to <value> for the 1-wire device <name>. The permitted values are defined by the underlying
|
||||
1-wire device type.
|
||||
<br><br>
|
||||
Example:
|
||||
<ul>
|
||||
<code>set myT1 templow 5</code><br>
|
||||
</ul>
|
||||
<br>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user