maziggy
41dd80b69f
Fix naive-vs-aware datetime crash from 0.2.1 timezone migration
The timezone fix (ed36eaf) replaced datetime.utcnow() with
datetime.now(timezone.utc) across ~80 call sites, but SQLAlchemy's
SQLite DateTime columns strip tzinfo on read, returning naive datetimes.
Any Python-side comparison (subtraction, <, >) between an aware "now"
and a naive DB value raises TypeError.
Add `if value.tzinfo is None: value = value.replace(tzinfo=timezone.utc)`
guards at all 9 affected comparison sites:
- maintenance.py: last_performed_at subtraction (2 code paths — days-based
and hours-based intervals both crashed on /maintenance/overview)
- auth.py: API key expires_at check (2 locations)
- print_scheduler.py: scheduled_time comparison
- smart_plug_manager.py: auto_off_pending_since elapsed calc
- smart_plugs.py: power_alert_last_triggered cooldown
- main.py: last_runtime_update elapsed calc
- archives.py: timelapse completed_at fallback
2026-02-27 17:46:52 +01:00
..
2026-02-24 08:18:02 +01:00
2026-02-03 09:13:00 +01:00
2026-02-27 17:39:32 +01:00
2026-02-27 13:34:19 +01:00
2026-02-20 08:51:13 +01:00
2026-02-11 07:09:39 +01:00
2026-02-15 08:04:01 +01:00
2026-02-08 12:17:20 +01:00
2026-02-06 11:37:59 +01:00
2026-02-18 11:58:17 +01:00
2026-02-03 09:13:00 +01:00
2026-02-06 11:37:59 +01:00
2026-01-31 12:50:15 +01:00
2026-02-26 08:42:19 +01:00
2026-02-15 08:04:01 +01:00
2026-02-21 16:48:42 +01:00
2026-02-09 17:00:02 +01:00
2026-02-27 17:46:52 +01:00
2026-02-04 07:20:17 +01:00
2026-02-10 00:18:33 +00:00
2026-02-24 08:18:02 +01:00
2026-02-06 11:58:38 +01:00
2026-02-15 13:14:15 +01:00
2026-02-26 08:15:38 +01:00
2026-02-22 16:43:16 +01:00
2026-02-20 16:23:00 +01:00
2026-02-19 16:15:01 +01:00
2026-02-27 17:39:32 +01:00
2026-02-22 15:27:54 +01:00
2026-02-13 07:53:14 +01:00
2026-02-23 09:24:53 +01:00
2026-02-15 14:01:54 +01:00
2026-02-19 16:15:01 +01:00
2026-02-10 08:57:09 -05:00
2026-02-18 06:37:27 +01:00
2026-02-06 11:37:59 +01:00
2026-02-20 08:51:13 +01:00