diff --git a/fhem/FHEM/34_SWAP.pm b/fhem/FHEM/34_SWAP.pm index f2a766458..491430063 100755 --- a/fhem/FHEM/34_SWAP.pm +++ b/fhem/FHEM/34_SWAP.pm @@ -746,10 +746,11 @@ SWAP_findFreeAddress($$) { my ($hash, $orig) = @_; - for( my $addr = 0xF0; $addr < 0xFF; $addr++ ) { + for( my $i = 0xF0; $i < 0xFF; $i++ ) { + my $addr = sprintf( "%02X", $i ); next if( $modules{SWAP}{defptr}{$addr} ); - return sprintf( "%02X", $addr ); + return $addr; } return $orig;