tlstommy / PiInk

An E-Ink digital picture frame that gives images a natural aesthetic.
MIT License
88 stars 6 forks source link

Album rotation - multiple images #6

Open NullVsNone opened 11 months ago

NullVsNone commented 11 months ago

Could this be enhanced to support uploading multiple images, with a set timer to rotate between the "album" of images?

Not very experienced in python (nor Pi(s)), but something along the lines of:

https://github.com/tlstommy/PiInk/blob/511791410bd8a3af3004ea20ad743f785f81900f/src/webserver.py#L89

https://github.com/tlstommy/PiInk/blob/511791410bd8a3af3004ea20ad743f785f81900f/src/webserver.py#L90

import sched, time, random

def cycle_album(scheduler): 
    scheduler.enter(3600, 1, cycle_album, (scheduler,))
    updateEink(random.choice(UPLOAD_FOLDER, ORIENTATION,ADJUST_AR)

album_schedule = sched.scheduler(time.time, time.sleep)
album_schedule.enter(3600, 1, cycle_album, (album_schedule,))
album_schedule.run()
tlstommy commented 11 months ago

Yes! This is actually something I've been planning on implementing once I have more time!

Thanks for your suggestions!