Git Product home page Git Product logo

photo-dash's People

Contributors

cj-wong avatar dark-nova avatar dependabot[bot] avatar

Watchers

 avatar

photo-dash's Issues

After the mypy-compliant change, multiple gauges cause errors with list population due to last_gauge_value attribute not being properly reset

After I refactored code to be compliant with mypy, photo-dash-sds011 has consistently gotten 500 status codes from the endpoint, caused by an IndexError on this line:

above = values[index + 1]

This IndexError is ultimately caused by self.last_gauge_value not being correctly updated. Initially, I thought the problem lay within this commit 1b3b956, specifically:

if (not getattr(self, 'last_gauge_value', None)
That is a separate problem that will be resolved.

The primary issue lies within this line:

# self.last_gauge_value = None

...where I commented out the line to comply with mypy (the variable couldn't be marked Any-ish). This caused the self.last_gauge_value attribute not to reset upon DashImg.create_gauge(). Because the photo-dash-sds011 module uses multiple gauges, ultimately an IndexError would happen on a list (values in method DashImg.gauge_value_text_collision()) that could never expand due to the its dependence on self.last_gauge_value.

Comment edited for line preview.

Implement quiet hours/do-not-disturb for when the frame might be off

I currently have the photo frame connected to a WiFi smart plug with Tasmota installed - the frame can be turned on and off automatically. Because the frame isn't capable of displaying an image when it's off, I think implementing quiet hours will save some storage writes (useful especially because SBCs primarily use micro SD cards which can fail after enough writes) along with some CPU cycles.

Currently, I think the best way to implement this is to create a secondary API endpoint (something like /quiet?) within photo-dash that only accepts GETs. The API should then return something like {"start": 21, "end": 7} where "start" references the start of quiet hours and "end" indicates when the normal API should become responsive.

Modules should check the secondary API maybe on a daily basis and save the updated information somewhere (and in memory) and check when it should not send those requests. If a module isn't aware of quiet time though, the primary API should return a no-op response (maybe 503 Service Unavailable).

Add a stale file checker

Currently, there is no way to quickly observe if a file is stale. Since the photo frame indiscriminately loads images from USB storage and the timestamp on each image is in small font, I think a worthwhile enhancement is to include a file checker, most likely within the utils module.

I plan to have the image look something like...

Stale Files

Some files ($number) are potentially out of date:

- photo-dash-module: $hours_out_of_date

...and so on, maybe listing all modules (and overflowing if necessary onto more images).

Some things that should be considered:

  • This functionality should be optional to preserve current behavior (so it will be enabled via the configuration file).
  • Quiet hours may need to be accounted for $hours_out_of_date.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.