Here in Thailand, and of course fire ants are a thing here, multiple species of ants seem to love electronics. I do not fully understand the phenomenon either, but nonetheless in an ant-ridden area, one must ant-proof the electrical devices.
Here are things I have personally found helpful:
1) Keep electronic equipment up on a table away from a wall. The more narrow or circuitous the ant route is to the equipment the better.
2) Try to keep electrical cords away from common ant paths, such as grooves between tiles, corners, edges, etc. Ants love to use cords as a path, too, if they find them, so this may have its limits.
3) If the ants find the equipment on the table, you may have to ant-proof the entire table. Put bowls of water, oil, or ant-poison of some sort around each table leg, and have all electrical cords loop down through a bowl of such as well before continuing to the "safe" zone of the table.
Steps 1-3 are the simpler, less invasive methods. Step 4 is more invasive, but likely more successful.
4) Open the electrical devices and sprinkle a powerful (be sure not to breathe any of it yourself--face mask while doing so is recommended) ant-poison powder at key places inside where ants would be likely to crawl. Reclose the device and rest easy--any ants finding their way in will not last long enough to build a nest there.
Fire ants are more intelligent than some might think. I gave boric acid to a friend to help poison the ants around his home. He used it outside for the fire ants as well. When they began dying from the poison, he witnessed a group of their soldier ants bring mud to bury the poison and make the area safe for the rest of the ants!
Boric acid is safe for humans and pets, but is death to insects who ingest it (takes more than just touching it in most cases). Mosquitoes, etc., won't ingest it, but is can be successfully used against ants, silverfish, and cockroaches when presented to them attractively. Mix it with sugar, even 80% sugar to 20% of boric acid powder should be effective without raising their alarm. Ants will take it back to the nest, and won't immediately perish, but it will there be able to help eradicate the nest.
Boric acid is NOT the poison I used inside the electronic devices. I used something far more potent and toxic--I don't know what it is, but it would probably be illegal in the states, banned by the FDA. Whatever is the most toxic thing available, and dry with long-lasting potency, is what I would recommend using inside the case. Don't forget it's there if you need to open the case for some reason down the line!