All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
- Fixed security alert for
urllib3. - Updated
requests.
- In image.py,
Section.get_instructions()was replaced with the more Pythonic direct access (i.e.Section.instructions).
- Fixed security alerts for
urllib3andjinja2, automated from GitHub.
- Fixed security alert regarding
Pillow.Pillowhas been bumped to the latest version,8.1.2.
- Added more details in the readme.
- Fixed accidental deletion of real life example image.
- In image.py:
DashImgis nowDashImage.- Issue #3, continued: Individual image sections from
DashImageare now their own classes, subclassingSection.- All sections, now and future, must be decorated with
@dataclass. - Each section must accept
yas its first argument and must also override__post_init__()and callsuper().__post_init__()on its first line, to ensure the attributeinstructionswill be created. - Each section's
__post_init__()should contain code that builds rendering instructions for the mainDashImageclass. - As a result of this refactor, all of the non-argument attributes for
DashImageare now placed module-level for access to all other classes. SectionGaugemethods no longer have redundant_gauge_in their names.SectionGauge.does_value_collide()no longer acceptsvalueas an argument, as it strictly usedSectionGauge.value. This change will not be applied toSectionGauge.offset(), even though one of its calls uses the same attribute, because its other calls use function-local variables.
- All sections, now and future, must be decorated with
- In image.py:
- Renamed
DashImg.gauge_text_collision()toDashImg.does_gauge_text_collide()andDashImg.gauge_value_text_collision()toDashImg.does_gauge_value_collide(). - Changed
valtovalueinDashImg.does_gauge_text_collide()andDashImg.does_gauge_value_collide().
- Renamed
- Fixed #3: fixed gauge rendering issues that came as a result of the
mypyrefactor.- Both
self.last_gauge_valueandself.last_gauge_offsetattributes forDashImgin image.py are now deleted inDashImg.create_gauge(), to restore similar behavior prior to themypyrefactor.
- Both
- Fixed (missing) documentation in image.py.
- The project has now been linted additionally by
mypyon top ofFlake8.- As a result, several functions had their type-hints and/or return values corrected.
SECTIONSin image.py was incorrectly typed and now should accurately represent the list of sections allowed.T_FONTin image.py could not be used as an alias and was dropped entirely.- If
QUIET_HOURScouldn't be set up in config.py, then rather than set it toNone, the variable isn't set altogether. AnAttributeErrorshould be caught where quiet hours are used: both in app.py and utils.py.
- When sending a JSON to the endpoint, the module name no longer needs to include
photo-dash-at the beginning. If the prefix is missing, it will be automatically added to the module name.
- Improved docs
- In reference of issue #1:
- Added optional fields
"quiet_start"and"quiet_end"in config.json.example. These should be integers to represent when quiet hours will begin or end. - Added another endpoint
/quietthat will return quiet hours with aGETrequest. - During quiet hours, a special image will be generated that indicates images may not be up-to-date. This image will be deleted when quiet hours are over.
- Added optional fields
- Status codes for
put()in the API were returned incorrectly.
get_number_half_width()in image.py should now acceptfloatinstead of strictlyint.
- The timestamp is now initialized when
DashImg.create()is called. - The photo frame is somehow scaling images past their intended borders. This has caused text to go offscreen. Now, text elements (including the footer) will have a small offset. Both title and footer will have a small spacer from the top and bottom. All text elements will have a small spacer from the nearest side.
- Gauge values (marks) should no longer obscure each other. In the case that a number might collide or intersect with a previous number, it will be skipped.
- Following on that, the value for a gauge should also not obscure its closest rendered values (on both sides).
- In the API,
"data"was changed to"sections"to conform with the existing file.
- Initial version