About electricity at Hogwarts:
I’m not sure where this conception that it’s against the rules to bring electronics to Hogwarts comes from. I don’t remember a rule being mentioned in canon and I can’t find anything to that end on the wiki.
It’s also not true that a spell is what prevents electronic devices from working at Hogwarts, It is, in fact, the high levels of magic present at Hogwarts that makes those devices “go haywire”.
Our thought is that, since it is canon that electronic devices can be made to work in areas of high magic if you replace their power source with magic, wizards could eventually optimize this process to the point that everyone at Hogwarts could have a laptop.
The other way of thinking is that, given enough time, a clever muggleborn will figure out a way to protect electronic devices from ambient magic. After all, personal electronic devices have only been around for a little while. By the time covered in canon, there probably wasn’t much research on the topic being done.
But after canon is where headcanons come in, which is, after all, what this blog is all about.