When he first shoots fire balls at you, move left and right and towards him. When you get close he will attack you with his stick. Take a few steps back to dodge the attack. When he stops, hit him. Repeat this until he kneels down. Then hit him as many times as possible. When he gets back up, repeat the process. Eventually he will curl up in a ball while swinging his bat. Wait until he is done and then attack him.
Dodge the fire bending. Run left to right, then right to left. Continue until you see a flashing light. Attack when you see it. Hit it with Aang. You will have Saka fighting with you to do double damage. After about a quarter way down on HP, the machine will start throwing fire around. It causes no real threat as long as you keep your distance.