-
Notifications
You must be signed in to change notification settings - Fork 4
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
Added BitcoinAverage as a provider #49
Added BitcoinAverage as a provider #49
Conversation
This will ensure that PlatformIO will automatically install the correct libraries and use the right speed for it's monitor function.
I've also removed the import since it was (seemingly) never used
Added option to mute speaker (on menu switches)
Small web interface improvements
Display when the ticker is being updated and when the last update happened
Added monitor speed and library depedencies
Resolved issues with incorrectly cased imports
It's autogenerated by the PIO Unified Debugger, so we shouldn't commit it either
Updated .gitignore to use standards
Removed duplicate code I left behind
Removed pointless folder
@BitcoinMitchell have you tried our |
@tmlee The simple endpoint only has a After some testing with a JSON array that only contains the ID's of the coins, the PaperLedger can load about 2700 before it's too much and returns a size of zero after initialization (which is around @tmlee, if you could add an endpoint that returns the 100 or 200 most popular coins (you could make this configurable with a |
@BitcoinMitchell I like the approach, specially from the frontend side but I still believe the backend should be more abstract and just parse any json into a meaningful ticker. After I address some issues with the battery itself I will look into this heavily and come up with a design which I will run through you so we can share thoughts. As always thank you so much for your contribution @tmlee Thank you for your contribution to the project :) |
@AIFanatic I'm not sure how you would make this even more abstract. We already have a provider which just gives you a generic object that you can use. At some point you have to parse the vendor specific response. 🤔 I'm excited to see what you can come up with and I'll be using this branch for now! 😁 |
@BitcoinMitchell It would be something around the lines of the backend only storing fixed generic data about providers by following a simple standard.
This method would work with any endpoint and the backend is completely abstracted from what is parsing, allowing to show crypto prices, stocks, weather etc (a similar method can be applied to the actual display/layout in order to generalise even further) Of course it has its quirks, one of them being how to handle different types of requests for example if OAuth is needed but for now it seems to suffice :) |
That does look pretty interesting (and relatively simple as well), so I'm all for JSONPath. However, I still would like to do all the calls in the backend and remove the provider classes I added in the frontend. It's too much coupling if you ask me. If CoinGecko gives us a way to limit the amount of coins they return (like the most popular 200, which would more than suffice if you ask me), we could keep the frontend totally oblivious to what the backend is actually doing. Storing a list of providers on GitHub seems like a decent idea, until you drop this project and remove the repository (extreme example, but you get the point). |
Are you referring to 100/200 popular coins in |
@tmlee I was thinking of something like this: curl -X GET "https://api.coingecko.com/api/v3/simple/popular_coins?maximum=100" -H "accept: application/json" [ "bitcoin", "ethereum", "dash", "ripple", ....] |
@AIFanatic I've started working on an alternative implementation of the providers using JSONPath. Sadly, the implementation that is available in the linked issue (bblanchon/ArduinoJson#821) does not have search capabilities so I had to be a bit creative. You can see the progress over here: https://github.com/BitcoinMitchell/PaperLedger/commits/providers-jsonpath Not sure if I'll be keeping the |
1346998
to
12cb0b6
Compare
12cb0b6
to
df84ff7
Compare
Hereby a draft pull request that implements the concept of multiple providers. Sadly, I had to add it to both the front- and backend, since the device itself doesn't have enough memory to store the full response of CoinGecko's available coins and I couldn't find a way to resolve that.
If you like my current solution, I can mark it as ready to be reviewed. If you have a better idea, let me know.