platypush/platypush/plugins/bluetooth
Fabio Manganiello c9a5c29a4a
🐛 A proper cross-version solution for the utcnow() issue.
No need to maintain two different pieces of logic - a `utcnow()` for
Python < 3.11 and `now(datetime.UTC)` for Python >= 3.11.

`datetime.timezone.utc` existed long before datetime.UTC and that's what
the `utcnow` facade should use.

This means that all the `utcnow()` will always have `tzinfo=UTC`
regardless of the Python version.

There's still a problem with the `utcnow()`-generated timestamps that
have been generated by previous versions of Python and stored on the db.

Therefore, when the code performs comparisons with timestamps fetched
from the db, it should always explicitly do a `.replace(tzinfo=utc)` to
ensure that we always compare offset-aware datetime representations.

See blog post for technical details:
https://manganiello.blog/wheres-my-time-again
2024-06-01 01:34:47 +02:00
..
_ble 🐛 A proper cross-version solution for the utcnow() issue. 2024-06-01 01:34:47 +02:00
_file [WIP] Big, big refactor of the Bluetooth integration. 2023-03-13 02:31:21 +01:00
_legacy Removed typing-extensions dependency. 2023-09-18 14:05:39 +02:00
_model Added OBEX_FILE_TRANSFER constant to directory stub. 2023-03-24 15:41:20 +01:00
_plugins Added support for custom Bluetooth device plugins. 2023-03-23 17:10:37 +01:00
__init__.py Misc documentation improvements. 2023-09-29 18:09:15 +02:00
_cache.py Removed typing-extensions dependency. 2023-09-18 14:05:39 +02:00
_manager.py Using the new StoppableThread API. 2023-03-24 16:39:30 +01:00
_types.py Added support for Bluetooth devices blacklist. 2023-03-24 01:52:39 +01:00
manifest.json [#394] All manifest.yaml converted to manifest.json. 2024-05-17 02:21:57 +02:00
model.py [WIP] Big, big refactor of the Bluetooth integration. 2023-03-13 02:31:21 +01:00