diff --git a/inky_phat_dashboard/const.py b/inky_phat_dashboard/const.py index 8d512d1..4884e34 100644 --- a/inky_phat_dashboard/const.py +++ b/inky_phat_dashboard/const.py @@ -56,6 +56,7 @@ class VerticalAlign(Enum): DEFAULT_WASTE_ALERT_DAYS = 1 DEFAULT_WASTE_DETAILED_DAYS = 3 DEFAULT_ENABLE_INKY = True +DEFAULT_FLIP_SCREEN = True RESTART_DELAY_SECONDS = 5 diff --git a/inky_phat_dashboard/image_generator.py b/inky_phat_dashboard/image_generator.py index b6b95e2..65d70a6 100644 --- a/inky_phat_dashboard/image_generator.py +++ b/inky_phat_dashboard/image_generator.py @@ -106,6 +106,10 @@ def generate_detailed_view( ) result = result.convert("P", palette=self._palette, colors=256) + + if self._config.flip_screen: + result = result.rotate(180) + return result def generate_detailed_view_two_lines( @@ -157,6 +161,10 @@ def generate_detailed_view_two_lines( ) result = result.convert("P", palette=self._palette, colors=256) + + if self._config.flip_screen: + result = result.rotate(180) + return result def generate_dashboard_view( @@ -218,4 +226,8 @@ def generate_dashboard_view( ) result = result.convert("P", palette=self._palette, colors=256) + + if self._config.flip_screen: + result = result.rotate(180) + return result diff --git a/inky_phat_dashboard/models.py b/inky_phat_dashboard/models.py index faa1691..1129998 100644 --- a/inky_phat_dashboard/models.py +++ b/inky_phat_dashboard/models.py @@ -13,6 +13,7 @@ DEFAULT_COLOR_MODE, DEFAULT_DATA_TIMEOUT_SECONDS, DEFAULT_ENABLE_INKY, + DEFAULT_FLIP_SCREEN, DEFAULT_FONT_PATH, DEFAULT_LOG_DATEFMT, DEFAULT_LOG_FILEMODE, @@ -147,6 +148,7 @@ class Config: waste_detailed_days: int = DEFAULT_WASTE_DETAILED_DAYS waste_alert_days: int = DEFAULT_WASTE_ALERT_DAYS enable_inky: bool = DEFAULT_ENABLE_INKY + flip_screen: bool = DEFAULT_FLIP_SCREEN config_file_path: Path = field(init=False, repr=False, compare=False)