51_I2C_BMP180: bugfix for poll_interval
52_I2C_MCP342x: bugfix for poll_interval 52_I2C_SHT21: bugfix for poll_interval git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@9272 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -132,12 +132,20 @@ sub I2C_BMP180_Init($$) {
|
|||||||
$hash->{I2C_Address} = hex(BMP180_I2C_ADDRESS);
|
$hash->{I2C_Address} = hex(BMP180_I2C_ADDRESS);
|
||||||
my $msg = '';
|
my $msg = '';
|
||||||
# create default attributes
|
# create default attributes
|
||||||
$msg = CommandAttr(undef, $name . ' poll_interval 5');
|
if (AttrVal($name, 'poll_interval', '?') eq '?') {
|
||||||
$msg = CommandAttr(undef, $name . ' oversampling_settings 3');
|
$msg = CommandAttr(undef, $name . ' poll_interval 5');
|
||||||
if ($msg) {
|
if ($msg) {
|
||||||
Log3 ($hash, 1, $msg);
|
Log3 ($hash, 1, $msg);
|
||||||
return $msg;
|
return $msg;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (AttrVal($name, '', '?') eq '?') {
|
||||||
|
$msg = CommandAttr(undef, $name . ' oversampling_settings 3');
|
||||||
|
if ($msg) {
|
||||||
|
Log3 ($hash, 1, $msg);
|
||||||
|
return $msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($hash->{HiPi_used}) {
|
if ($hash->{HiPi_used}) {
|
||||||
my $dev = shift @$args;
|
my $dev = shift @$args;
|
||||||
|
|||||||
@@ -113,11 +113,13 @@ sub I2C_MCP342x_Init($$) {
|
|||||||
|
|
||||||
my $msg = '';
|
my $msg = '';
|
||||||
# create default attributes
|
# create default attributes
|
||||||
#$msg = CommandAttr(undef, $name . ' poll_interval 5');
|
if (AttrVal($name, 'poll_interval', '?') eq '?') {
|
||||||
if ($msg) {
|
$msg = CommandAttr(undef, $name . ' poll_interval 5');
|
||||||
Log3 ($hash, 1, $msg);
|
if ($msg) {
|
||||||
return $msg;
|
Log3 ($hash, 1, $msg);
|
||||||
}
|
return $msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
AssignIoPort($hash);
|
AssignIoPort($hash);
|
||||||
$hash->{STATE} = 'Initialized';
|
$hash->{STATE} = 'Initialized';
|
||||||
|
|
||||||
@@ -158,7 +160,7 @@ sub I2C_MCP342x_Attr (@) {# hier noch Werteueberpruefung einfuegen
|
|||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
} elsif ($val > 0) {
|
} elsif ($val > 0) {
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
InternalTimer(1, 'I2C_MCP23017_Poll', $hash, 0);
|
InternalTimer(1, 'I2C_MCP342x_Poll', $hash, 0);
|
||||||
} else {
|
} else {
|
||||||
$msg = 'Wrong poll intervall defined. poll_interval must be a number > 0';
|
$msg = 'Wrong poll intervall defined. poll_interval must be a number > 0';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,11 +78,13 @@ sub I2C_SHT21_Init($$) {
|
|||||||
|
|
||||||
my $msg = '';
|
my $msg = '';
|
||||||
# create default attributes
|
# create default attributes
|
||||||
$msg = CommandAttr(undef, $name . ' poll_interval 5');
|
if (AttrVal($name, 'poll_interval', '?') eq '?') {
|
||||||
if ($msg) {
|
$msg = CommandAttr(undef, $name . ' poll_interval 5');
|
||||||
Log3 ($hash, 1, $msg);
|
if ($msg) {
|
||||||
return $msg;
|
Log3 ($hash, 1, $msg);
|
||||||
}
|
return $msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
AssignIoPort($hash);
|
AssignIoPort($hash);
|
||||||
$hash->{STATE} = 'Initialized';
|
$hash->{STATE} = 'Initialized';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user