Closed IngmarStein closed 1 week ago
I think this is awesome (especially how annoying it was to build the image I made). The only caveat is until I learn how this works better (which I guess I have to now lol), I will need you to help me out if I add any features in the future. If you’re alright with that, I’ll accept this PR.
Sure, no problem with that!
@IngmarStein I downloaded this to test on my machine and none of the services are working. Reverted the changes, can you do a PR into the dev version of the addon so I can test in my dev environment? Or let me know if there’s something I’m missing.
Let me take a look. I've tested this container by building and running it locally and sending it HTTP requests but probably made some wrong assumptions how these requests look like when coming from the integration. I'll set up a devcontainer setup following https://developers.home-assistant.io/docs/add-ons/testing/ to facilitate local testing. This might even allow us to remove the dev copy.
I figured it out, the integration sends requests to http://url:port/hooks/tidbyt-push. We either need to remove the hooks portion in the integration url (http://url:port/tidbyt-push) or we can add /hooks to http.HandleFunc's in main.go. Your call.
Excellent! Removing the /hooks
part seems cleaner to me, wdyt?
Yeah that works for me
I tested the text service works fine but push and publish are not working. Gonna look into it to see what's up.
I've posted #6 as a take two with an improved testing infrastructure and better logging.
It's a draft until I've verified push and publish.
Push and Publish are not working because the integration is sending a string to starargs but it’s expecting an array. If I send it from my phone using the Shortcuts app with a blank array or omit starargs altogether it works, so I will update the integration to parse out the arguments into an array and send it that way.
If you're open to changing the integration, how about passing a map instead? That is, instead of
["key=value", "key2=value2"]
it would be
{
"key": "value",
"key2": "value2"
}
That would remove the remaining string parsing on the server side.
Instead of using shell scripts invoked by the webhooks binary, use the pixlet library and the Tidbyt API directly. This has multiple advantages:
cache
module (the pixlet CLI always runs apps with an empty cache)