I2C_TSL2561: set gain/integrationTime attributes correctly during fhem startup

git-svn-id: https://svn.fhem.de/fhem/trunk@8697 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
kaihs 2015-06-05 21:41:08 +00:00
parent a21ec8fa95
commit f45eb66f7b

View File

@ -901,6 +901,9 @@ sub I2C_TSL2561_SetIntegrationTime($$) {
my ($hash, $time) = @_;
my $name = $hash->{NAME};
# store the value even if $hash->{tsl2561Package} ist not set (yet). That happens
# during fhem startup.
$hash->{tsl2561IntegrationTime} = $time;
# Enable the device by setting the control bit to 0x03
my $success = 0;
if (!AttrVal($hash->{NAME}, "disable", 0) && defined($hash->{tsl2561Package})) {
@ -953,6 +956,9 @@ sub I2C_TSL2561_SetGain($$) {
my ($hash, $gain) = @_;
my $name = $hash->{NAME};
# store the value even if $hash->{tsl2561Package} ist not set (yet). That happens
# during fhem startup.
$hash->{tsl2561Gain} = $gain;
# Enable the device by setting the control bit to 0x03
my $success = 0;
if (!AttrVal($hash->{NAME}, "disable", 0) && defined($hash->{tsl2561Package})) {