aCallum / SafePi

SafePi is a Python based tracking tool for Safemoon, aimed to be run on a Raspberry Pi with GPIO displays.
27 stars 5 forks source link

Functionality to make the screen only turn on at set intervals. #4

Open jimmymcmahoncoding opened 3 years ago

jimmymcmahoncoding commented 3 years ago

Hi Callum.

First and foremost this is a brilliant project so thank you for sharing. Not being able to easily see my Safemoon portfolio balance (without manual calculations) was annoying, so I wrote a basic Python script which used requests / Beautiful soup to scrape the current price from Bitmart and Whitebit and then multiply that by a variable which contained my balance (this was not a real time balance). I didn't even know about the bscscan API until I saw you project so thank you for highlighting that too.

Would it be possible to implement functionality to set an interval in which the screen is on?
For example, only having the display on for 5 minutes at the start of every hour / half hour and then turn itself back off again until the start of the next hour / half hour?

I guess this is relatively simple with some if statements in conjunction with the time module, but this is the first project that I have seen that utilises the modules / packages that interact with the screen itself.

Many thanks Jimmy

aCallum commented 3 years ago

Hey, thanks for the kind words. Some sort of display interval timer could be possible - I've found timers in Python quite annoying so havn't spent much time on this implementation so it's a bit rubbish. I'll add it to my backlog next time I do some updates

jimmymcmahoncoding commented 3 years ago

Hey, thanks for the kind words. Some sort of display interval timer could be possible - I've found timers in Python quite annoying so havn't spent much time on this implementation so it's a bit rubbish. I'll add it to my backlog next time I do some updates

Great stuff, thank you Callum.

If I get some spare time and make any headway in tinkering with the timing code I will share here or in a fork.

As a side note, in my non-display based version of the price tracker I was trying to pull a "real-time" USD to GBP conversion value via an API call but the first few I tried did not offer that conversion within their free API tier. I gave up on that idea in the end due to the conversion rate never really deviating from around the 0.7 mark. It certainly isn't as volatile a number as a crypto price haha.