mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
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:
parent
a0884081d9
commit
393684c566
@ -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 {
|
||||||
|
RemoveInternalTimer($hash);
|
||||||
|
$hash->{fhem}{interval}= $value;
|
||||||
|
InternalTimer(int(gettimeofday())+$hash->{fhem}{interval}, "OWDevice_UpdateValues", $hash, 0)
|
||||||
|
}
|
||||||
} else {
|
} 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>
|
<a name="OWDeviceset"></a>
|
||||||
<b>Set</b>
|
<b>Set</b>
|
||||||
<ul>
|
<ul>
|
||||||
<code>set <name> <reading> <value></code>
|
<li><code>set <name> interval <value></code>
|
||||||
<br><br>
|
<br><br>
|
||||||
Sets <reading> to <value> for the 1-wire device <name>. The permitted values are defined by the underlying
|
<code>value</code> modifies the interval for polling data. The unit is in seconds.
|
||||||
1-wire device type.
|
</li>
|
||||||
<br><br>
|
<li><code>set <name> <reading> <value></code>
|
||||||
Example:
|
<br><br>
|
||||||
<ul>
|
Sets <reading> to <value> for the 1-wire device <name>. The permitted values are defined by the underlying
|
||||||
<code>set myT1 templow 5</code><br>
|
1-wire device type.
|
||||||
</ul>
|
<br><br>
|
||||||
<br>
|
Example:
|
||||||
|
<ul>
|
||||||
|
<code>set myT1 templow 5</code><br>
|
||||||
|
</ul>
|
||||||
|
<br>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user