Replaced dryer door switch.
There were two prongs on right side of switch. The first one I tried the dryer worked only when the door was open. Used the other prong and dryer worked properly.
I have combo washer/dryer so I had to climb a stepladder a few times, repair time about 30 minutes.