2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

OWSWITCH.pm: Bugfix in der Ankopplung an OWServer

git-svn-id: https://svn.fhem.de/fhem/trunk@11216 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
pahenning 2016-04-10 08:12:19 +00:00
parent 8ba6f9b5d9
commit f990f8b8b3

View File

@ -87,7 +87,7 @@ no warnings 'deprecated';
sub Log($$);
my $owx_version="6.01";
my $owx_version="6.02";
#-- fixed raw channel name, flexible channel name
my @owg_fixed = ("A","B","C","D","E","F","G","H");
my @owg_channel = ("A","B","C","D","E","F","G","H");
@ -783,19 +783,16 @@ sub OWSWITCH_Set($@) {
#-- OWFS interface
}elsif( $interface eq "OWServer" ){
$ret1 = OWFSSWITCH_GetState($hash);
my $gpio = 0;
#--
my $gpio = 0;
for (my $i=0;$i<$cnumber{$attr{$name}{"model"}};$i++){
if( $outval==0 ){
$gpio += ($hash->{owg_vax}->[$i]<<$i)
if( $i != $outfnd );
}else{
$gpio += ($hash->{owg_vax}->[$i]<<$i);
$gpio += (1<<$i)
if( $i == $outfnd );
}
}
$ret2 = OWFSSWITCH_SetState($hash,$value);
$gpio += ($hash->{owg_vax}->[$i]<<$i)
};
if( $outval==0 ){
$gpio &= ~(1<<$outfnd);
}else{
$gpio |= (1<<$outfnd);
}
$ret2 = OWFSSWITCH_SetState($hash,$gpio);
#-- Unknown interface
}else{
return "OWSWITCH: Get with wrong IODev type $interface";