monkeymademe / piritos

42 stars 6 forks source link

Proposed changes: HomeAssistant and WLED integration #9

Open ducksauz opened 2 weeks ago

ducksauz commented 2 weeks ago

Hey James,

Thanks for merging my venv PR.

I've got a touchscreen Pi on my desk that will make an amazing LCARS control panel for my home office. I found this project and would like to do the work to bring HomeAssistant (after this issue gets fixed) and WLED support in. Along the way, I'll also do the work to add a config file (already started), clean up linter issues, and do some general best practice cleanups.

So, I've got more coming if you're up for it, and if not, I'll guess I'll make a hard fork?

Also, do you know if meWho_System47 is open to sharing their source? I'd love to swap out one of the main menu items (like Buffer Time) for a configurable screen for home automation items. I can probably reverse engineer it from their minified HTML and JS, but working with the originals would be way easier.

Best, -j

ducksauz commented 1 week ago

So, it looks like I'm going to end up doing a hard fork, largely because I've never found a yak I didn't want to shave. I'm using the work of adding Home Assistant support here as an opportunity to learn how to do async web programming.

You've already got some background and scheduled co-routines using Flask-APScheduler. To do async calls to Home Assistant, one needs to use asyncio. While Flask can do asyncio, the Flask team has released a new module called Quart that provides background and scheduled co-routines as well as websocket support , so I'm going to give that a shot.