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
urllib3
andjinja2
, automated from GitHub.
- Fixed security alert regarding
Pillow
.Pillow
has 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:
DashImg
is nowDashImage
.- Issue #3, continued: Individual image sections from
DashImage
are now their own classes, subclassingSection
.- All sections, now and future, must be decorated with
@dataclass
. - Each section must accept
y
as its first argument and must also override__post_init__()
and callsuper().__post_init__()
on its first line, to ensure the attributeinstructions
will be created. - Each section's
__post_init__()
should contain code that builds rendering instructions for the mainDashImage
class. - As a result of this refactor, all of the non-argument attributes for
DashImage
are now placed module-level for access to all other classes. SectionGauge
methods no longer have redundant_gauge_
in their names.SectionGauge.does_value_collide()
no longer acceptsvalue
as 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
val
tovalue
inDashImg.does_gauge_text_collide()
andDashImg.does_gauge_value_collide()
.
- Renamed
- Fixed #3: fixed gauge rendering issues that came as a result of the
mypy
refactor.- Both
self.last_gauge_value
andself.last_gauge_offset
attributes forDashImg
in image.py are now deleted inDashImg.create_gauge()
, to restore similar behavior prior to themypy
refactor.
- Both
- Fixed (missing) documentation in image.py.
- The project has now been linted additionally by
mypy
on top ofFlake8
.- As a result, several functions had their type-hints and/or return values corrected.
SECTIONS
in image.py was incorrectly typed and now should accurately represent the list of sections allowed.T_FONT
in image.py could not be used as an alias and was dropped entirely.- If
QUIET_HOURS
couldn't be set up in config.py, then rather than set it toNone
, the variable isn't set altogether. AnAttributeError
should 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
/quiet
that will return quiet hours with aGET
request. - 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 acceptfloat
instead 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