cj-wong / photo-dash Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
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:
$hours_out_of_date
.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:
photo-dash/photo_dash/image.py
Line 349 in 62e0544
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:
photo-dash/photo_dash/image.py
Line 238 in 1b3b956
The primary issue lies within this line:
photo-dash/photo_dash/image.py
Line 214 in 1b3b956
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.
DashImage currently accepts an optional argument y
which by default is 0. However, because this vertical offset can be something other than 0, DashImage.sections_fit()
should reflect the remaining space from wherever y
is, until the bottom edge.
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
).
photo-dash/photo_dash/image.py
Line 36 in 89bc82f
Right now, the value uses hard-coded numbers to determine the pixel width of one monospace character, given a font and size.
Plus, the 16 * 10 / 16
looks very tacky...
For more information, see: cj-wong/photo-dash-base#1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.