10_IT.pm: Fix wrong dim state for on/off switching

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@8311 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
dancer0705 2015-03-28 15:40:22 +00:00
parent 5b26ba93e0
commit 2f4d55d10d

View File

@ -2,9 +2,11 @@
# InterTechno Switch Manager as FHM-Module # InterTechno Switch Manager as FHM-Module
# #
# (c) Olaf Droegehorn / DHS-Computertechnik GmbH # (c) Olaf Droegehorn / DHS-Computertechnik GmbH
# (c) Björn Hempel
# #
# Published under GNU GPL License # Published under GNU GPL License
######################################################package main; ######################################################
package main;
# $Id$ # $Id$
@ -550,10 +552,14 @@ IT_Parse($$)
} }
if ($def->{$name}->{$it_c2b{"on"}} eq lc($onoffcode)) { if ($def->{$name}->{$it_c2b{"on"}} eq lc($onoffcode)) {
$newstate="on"; $newstate="on";
readingsSingleUpdate($def->{$name},"dim",1,1); if( AttrVal($name, "model", "") eq "itdimmer" ) {
readingsSingleUpdate($def->{$name},"dim",1,1);
}
} elsif ($def->{$name}->{$it_c2b{"off"}} eq lc($onoffcode)) { } elsif ($def->{$name}->{$it_c2b{"off"}} eq lc($onoffcode)) {
$newstate="off"; $newstate="off";
readingsSingleUpdate($def->{$name},"dim",0,1); if( AttrVal($name, "model", "") eq "itdimmer" ) {
readingsSingleUpdate($def->{$name},"dim",0,1);
}
} elsif ('d' eq lc($onoffcode)) { } elsif ('d' eq lc($onoffcode)) {
# dim # dim
my $binVal = ((bin2dec($dimCode)+1)*100)/16; my $binVal = ((bin2dec($dimCode)+1)*100)/16;