Closed thor0215 closed 1 month ago
It's looking pretty good, thanks. I would probably remove the hassio env from the python and just do a
if pooling_rate == 0:
EXIT(SUCCESS)
The python script doesn't really need to know you are running inside hassio.
Also you can extract the MQTT code to another file and just use it as a listener that will be called once data arrives. If MQTT, create class and attach to a listener list. Then you can have log also be a listener, etc. Just some separation of concerns inside the main python.
Some small nits could also be splitting the browser logic into steps (one action, supports retries, what element(s) to expect, presence of element A should indicate moving forward, presence of element B should indicate retry or abandonment) I believe playwright had a way to say: looking into the DOM and try to find one of these n elements in parallel so you can say search for password and username at the same time to validate the happy path and error path. Then would could encapsulate each browser step into a class, register all the steps as if they were a state machine and just run the state machine. Just some ideas from someone looking from the outside. Cheers and keep up the great work!
Some small nits could also be splitting the browser logic into steps (one action, supports retries, what element(s) to expect, presence of element A should indicate moving forward, presence of element B should indicate retry or abandonment) I believe playwright had a way to say: looking into the DOM and try to find one of these n elements in parallel so you can say search for password and username at the same time to validate the happy path and error path. Then would could encapsulate each browser step into a class, register all the steps as if they were a state machine and just run the state machine. Just some ideas from someone looking from the outside. Cheers and keep up the great work!
I've thought some on this and am realizing I just do not have enough programming experience with creating classes and subclasses. I like the idea of creating more separation, I'm just not sure where to start I guess.
Switched User Agent to Android. Set Android (10-13) and Firefox (120-124) versions randomly.
No longer using browser persistent storage. I didn't really help anything
Added exit code enum class to better track exit codes
Changed LOGLEVEL Addon variable to LOG_LEVEL so it links to bashio's log level variable
Improve the usage of the addon by non-hassio consumers (docker and kubernetes) #36
Dependency updates