Yeah, not to mention, adding any sort of electronic components to the thing would be dicey at best. A lot of bathrooms don't even have power outlets anywhere near the toilet.
I'd prefer some sort of pressure-activated valve or something, but this is an engineering challenge that's beyond my meager skills.