diff --git a/README.md b/README.md index 7f0770c..81a209c 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,10 @@ Exported functions: - `reflow(text)`: split text into a list of lines not exceeding terminal width - `print_paged(text)`: reflow and print the text in a paginated manned, prompting for Enter presses to move to the next page +### `deck.time` + +A wrapper for standard Python `date`, `time` and `datetime` modules. Just run `from deck.time import *` to activate. + ### `deck.chat` A generic chat UI helper library. Exports a single class called `DeckChat` with the following parameters: @@ -251,10 +255,10 @@ The foundational module set is going to at least include high-level capabilities - exposing low-level socket and HTTP APIs (done), - high-level HTTP APIs, - high-level LLM APIs (partially done), -- date and time informaion, +- date and time informaion (done), - file system manipulation (done), - text viewing and editing (done), -- device information collection, +- device information collection (partially done), - chat UI creation (done). After all this is implemented, future phases may also include device-specific features like GPS, graphics, sound and touchscreen input. diff --git a/deck/time.py b/deck/time.py new file mode 100644 index 0000000..d9fc096 --- /dev/null +++ b/deck/time.py @@ -0,0 +1,8 @@ +# Datetime wrapper for T-DeckARD +# Usage: from deck.time import * +# Created by Luxferre in 2025, released into public domain + +try: + from adafruit_datetime import datetime, date, time +except: + import datetime, date, time diff --git a/requirements.txt b/requirements.txt index ac039de..bd340a3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ adafruit_connection_manager>=3.1.6 adafruit_requests>=4.1.15 adafruit_bus_device>=5.2.14 +adafruit_datetime>=1.4.4 diff --git a/tdeckboot.py b/tdeckboot.py index 8aca607..cb7e544 100644 --- a/tdeckboot.py +++ b/tdeckboot.py @@ -7,6 +7,7 @@ from deck.fs import unlock_rootfs, lock_rootfs, mount_sd, umount_sd, env, rnd from deck.fs import du, df, sep, pwd, ls, md, cd, rd, rm, mv, cp, sync from deck.input import input, input_multi from deck.pager import print_paged, term_size +from deck.time import * from deck.hwinfo import board_id, battery_v from app.ed import edit, view try: