Our previous computer app was a failure. Happens from time to time:) Choosing wxPython was a huge mistake. Seems wx bindings are outdated.
After a long walk to cool of my head and think a little (but mostly catching pokemons) I recovered my strength and began second approach. This time I’m using PyQt5. It has Python3 bindings and lots of nice features, like ability to emit signals to other objects.
Spoiler: this time a full success 🙂
Get source from GitHub
We need something to see the state. I think the best way is to display icon in the taskbar. It must work under Windows 10 and Ubuntu/Mint.
To build GUI I will try and use wxPython. Sadly their bindings are for Python 2.7 not 3.x. I found wxPython Phoenix Project but for now lets stick with official release.
Spolier: we gonna fail – see running section. This is why code is dirty and nasty – no reason for refactor.
We have a small problem at the office. This problem is only one toilet. Additionally not all rooms can see it and know if it is busy or not. So quite often someone runs and slams into closed door.
Such runner has two options, form or join queue and wait or go back to desk and return later.
It would be much better for all of us if we could check toilet status from our desks.
How to do it? Simplest way is to detect if light is enabled. Hopefully this would be enough. If not I have another idea 🙂
As light detector I’m going to use lm393 light sensor and as the brain NodeMCU v3.