Dd-wrt firewall switch integration

Background:

I needed the ability to disconnect computers on my network from the internet. Mostly for parental controls. I needed this to be either on a schedule or with a button- both needed to be easy for my wife to use. My dd-wrt installation has access restrictions with a schedule but it is not very flexible and my wife would not be logging in to change it. It doesn’t allow any dynamic, on demand, restrictions.

I searched through the home assistant features and found only presence detection code for the dd-wrt so I thought I’d have to write my own solution.

I set up key based ssh access to the router, wrote a python script on the home-assistant computer that sshs into the router and creates or deletes the necessary iptables rules to connect or disconnect clients from the external internet. I then connected that script to a shell switch in home assistant and everything works. Yay!

Question:

After finishing this project, I stumbled across these forums and found a few posts over the years asking how to accomplish this exact same task.

What is the mechanism by which this solution could be packaged into an official HA feature? I’m willing to do it but I don’t know the rules or where to get started.