diff --git a/dnull_mqtt/apps/notion.py b/dnull_mqtt/apps/notion.py index 89f9df7..4ba166f 100644 --- a/dnull_mqtt/apps/notion.py +++ b/dnull_mqtt/apps/notion.py @@ -27,38 +27,7 @@ def _get_todays_todo(self): database = self.notion.databases.query( **{ "database_id": self.config.notion_database_id, - "filter": { - # "and": [ - # { - "property": "Time", - "date": { - "this_week": {}, - }, - # }, - # { - # "or": [ - # { - # "property": "Status", - # "status": { - # "equals": "Backlog", - # }, - # }, - # { - # "property": "Status", - # "status": { - # "equals": "Soon", - # }, - # }, - # { - # "property": "Status", - # "status": { - # "equals": "In progress", - # }, - # } - # ] - # }, - # ], - }, + "filter": self.config.notion_database_filter, "sorts": [{"property": "Time", "direction": "ascending"}], } ) @@ -114,7 +83,7 @@ def run(self): if all_tasks_no == 0: message = "--Middle grey::No tasks--" else: - todo_statuses = ["Backlog", "Soon", "In progress"] + todo_statuses = self.config.notion_todo_statuses todo = list() for task in tasks: if task["status"] in todo_statuses: @@ -128,4 +97,5 @@ def run(self): self._set_icon(todo_tasks_no, all_tasks_no) self._set_scroll_speed(task_names) - self.mqtt.publish(self.awtrix.message(message)) + log.info(self.awtrix.message(message)) + # self.mqtt.publish(self.awtrix.message(message)) diff --git a/dnull_mqtt/config.py b/dnull_mqtt/config.py index 902911c..34a72df 100644 --- a/dnull_mqtt/config.py +++ b/dnull_mqtt/config.py @@ -23,3 +23,20 @@ def __init__(self) -> None: # Notion self.notion_database_id = environ.get("NOTION_PAGE") self.notion_token = environ.get("NOTION_TOKEN") + self.notion_todo_statuses = ["Backlog", "Ready", "In progress"] + self.notion_database_filter = { + "and": [ + { + "property": "Time", + "date": { + "this_week": {}, + }, + }, + { + "property": "Name", + "rich_text": { + "does_not_contain": "Journal: ", + }, + }, + ], + }