mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 20:20:10 +00:00
51_I2C_BH1750.pm: fixed poll_interval checking, added 0.1 min. intervall, added pod summary
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@12274 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a6b6252c85
commit
5fb475504d
@ -110,7 +110,7 @@ sub I2C_BH1750_Initialize($)
|
|||||||
$hash->{AttrFn} = "I2C_BH1750_Attr";
|
$hash->{AttrFn} = "I2C_BH1750_Attr";
|
||||||
$hash->{SetFn} = "I2C_BH1750_Set";
|
$hash->{SetFn} = "I2C_BH1750_Set";
|
||||||
$hash->{I2CRecFn} = 'I2C_BH1750_I2CRec';
|
$hash->{I2CRecFn} = 'I2C_BH1750_I2CRec';
|
||||||
$hash->{AttrList} = "poll_interval:0.2,0.5,1,2,5,10,20,30,60 IODev percentdelta correction ".
|
$hash->{AttrList} = "poll_interval:0.1,0.2,0.5,1,2,5,10,20,30,60 IODev percentdelta correction ".
|
||||||
$readingFnAttributes;
|
$readingFnAttributes;
|
||||||
$hash->{VERSION} = '$Id$';
|
$hash->{VERSION} = '$Id$';
|
||||||
}
|
}
|
||||||
@ -209,8 +209,8 @@ sub I2C_BH1750_Attr (@)
|
|||||||
$hash->{BASEINTERVAL} = 0;
|
$hash->{BASEINTERVAL} = 0;
|
||||||
$hash->{PollState} = BH1750_POLLSTATE_IDLE;
|
$hash->{PollState} = BH1750_POLLSTATE_IDLE;
|
||||||
} else {
|
} else {
|
||||||
if($val !~ /^\d+$/ or $val < 1) {
|
if($val !~ /^\d+/) {
|
||||||
return $error."needs interger value";
|
return $error."needs numeric value";
|
||||||
} else {
|
} else {
|
||||||
$hash->{BASEINTERVAL} = 60*$val;
|
$hash->{BASEINTERVAL} = 60*$val;
|
||||||
I2C_BH1750_Restart_Measure($hash,$hash->{RESTARTDELAY});
|
I2C_BH1750_Restart_Measure($hash,$hash->{RESTARTDELAY});
|
||||||
@ -510,6 +510,9 @@ sub I2C_BH1750_sleep
|
|||||||
1;
|
1;
|
||||||
|
|
||||||
=pod
|
=pod
|
||||||
|
=item device
|
||||||
|
=item summary support for the BH1750 I2C light sensor
|
||||||
|
=item summary_DE Unterstützung für den BH1750 I2C Lichtsensor
|
||||||
=begin html
|
=begin html
|
||||||
|
|
||||||
<a name="I2C_BH1750"></a>
|
<a name="I2C_BH1750"></a>
|
||||||
@ -602,7 +605,7 @@ sub I2C_BH1750_sleep
|
|||||||
<li>poll_interval<br>
|
<li>poll_interval<br>
|
||||||
Set the polling interval in minutes to query the sensor for new measured values.
|
Set the polling interval in minutes to query the sensor for new measured values.
|
||||||
By changing this attribute a new illumination measurement will be triggered.<br>
|
By changing this attribute a new illumination measurement will be triggered.<br>
|
||||||
valid values: 0.2, 0.5, 1, 2, 5, 10, 20, 30, 60<br>
|
valid values: 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 30, 60<br>
|
||||||
</li>
|
</li>
|
||||||
<li>percentdelta<br>
|
<li>percentdelta<br>
|
||||||
If set a luminosity reading is only generated if
|
If set a luminosity reading is only generated if
|
||||||
|
Loading…
x
Reference in New Issue
Block a user