Automatic input switching is due to HDMI-CEC. If your device doesn’t support HDMI-CEC, then it will not automatically switch. CEC is why for the TV will automatically assign the input a name like “Apple TV”.
If you want this to not happen, you should check if you can disable CEC on the device. Look for settings like “Match TV Power State” if HDMI-CEC isn’t explicitly stated in the device settings.
To disable this on the TV, go to Settings, External Device Manager, and toggle the “Anynet+ (HDMI-CEC)” switch.