-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/rest api (advanced and cleaned) #100
Conversation
added GetStatus added GetData removed GetPluginList
- separated getStatus and getMetadata
May be im not firm enought to gh, but wouldnt it hae been smarter to let you join on PR #98? I guess now i should cose that, right? After brief reviev: Since the handlers have nothing at all to do with message handling, i would not want to see them there nor would have ever serched them there. Having them distributed all over the place is even not so nice and comes with a include dependency hell (ok, a lot of). I think it is way better to keep them with the webserver, as it was done with the web socket implementations. I would be totally ok if you move the message handlers as well out of message.cpp... |
not sure what "May be im not firm enought to gh" means, tbh ...
I half agree and half disagree. You are right, the rest of the message file does have nothing to do with handling web requests and all those handlers belong somewhere else.
I'll look into that as well. update: @kohlsalem updated my branch - extracted the handlers to separate file, including the message handlers. |
Dependency hell was if i put the handlers where they beloned to (Screen, Plugin Manager, ...) |
Thank you both! I only have one thing. There are often comments that offer no added value. I would suggest identifying and deleting them. I mean something like this: // Send a response to the client
request->send(200, "text/plain", "Message received");
// Call the add function with the extracted parameters
Messages.remove(id);
// Extract the 'value' parameter from the request
int value = request->arg("value").toInt(); The code itself explains what happens here. |
Fair point. I never wrote them, they are a gift of "Check and comment the following code" request to chatgpt. @gelse, it least i take no offence from getting them removed, if anyone woulf have cared :-D |
Thanks for the work here! I'm using this currently with home assistant, the LED matrix now shows the artist + track that my internet radio is playing, which beside the clock animation is pretty cool. Also the brightness is reduced once the sun goes down. For those interested here the HA config for the internet radio in configuration.yaml
And the automation itself
@ph1p any idea if it can be merged? |
Sure! I'll test it tomorrow and merge it afterwards :) |
Many thanks to al of you! :) The PR has been merged. I've updated the code a bit so that each endpoint is now prefixed with /api. I also removed |
Based on the work of @kohlsalem, but slightly improved with the following topics: