added new set command "interval" to OWDevice

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@2560 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mfr69bs 2013-01-24 14:22:43 +00:00
parent a0884081d9
commit 393684c566

View File

@ -565,8 +565,18 @@ OWDevice_Set($@)
OWDevice_WriteValue($hash,$cmdname,$value); OWDevice_WriteValue($hash,$cmdname,$value);
readingsSingleUpdate($hash,$cmdname,$value,1); readingsSingleUpdate($hash,$cmdname,$value,1);
return undef; 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 { } else {
return "Unknown argument $cmdname, choose one of " . join(" ", @setters); RemoveInternalTimer($hash);
$hash->{fhem}{interval}= $value;
InternalTimer(int(gettimeofday())+$hash->{fhem}{interval}, "OWDevice_UpdateValues", $hash, 0)
}
} else {
return "Unknown argument $cmdname, choose one of interval " . join(" ", @setters);
} }
} }
@ -741,7 +751,11 @@ OWDevice_Define($$)
<a name="OWDeviceset"></a> <a name="OWDeviceset"></a>
<b>Set</b> <b>Set</b>
<ul> <ul>
<code>set &lt;name&gt; &lt;reading&gt; &lt;value&gt;</code> <li><code>set &lt;name&gt; interval &lt;value&gt;</code>
<br><br>
<code>value</code> modifies the interval for polling data. The unit is in seconds.
</li>
<li><code>set &lt;name&gt; &lt;reading&gt; &lt;value&gt;</code>
<br><br> <br><br>
Sets &lt;reading&gt; to &lt;value&gt; for the 1-wire device &lt;name&gt;. The permitted values are defined by the underlying Sets &lt;reading&gt; to &lt;value&gt; for the 1-wire device &lt;name&gt;. The permitted values are defined by the underlying
1-wire device type. 1-wire device type.
@ -751,6 +765,7 @@ OWDevice_Define($$)
<code>set myT1 templow 5</code><br> <code>set myT1 templow 5</code><br>
</ul> </ul>
<br> <br>
</li>
</ul> </ul>