Skip to content

feat: correlate DTEK planned windows with Shelly outage timing safely - #152

Draft
iSentinel wants to merge 1 commit into
mainfrom
feat/dtek-shelly-outage-correlation
Draft

iSentinel wants to merge 1 commit into
mainfrom
feat/dtek-shelly-outage-correlation

Conversation

@iSentinel

Copy link
Copy Markdown
Owner

Summary

New standalone pure-Python dtek_correlation.py compares timing only between events recorded by Shelly and dated DTEK scheduled-outage windows. It never assigns a verified cause to a power loss, and a Shelly network disconnection is not proof of mains failure.

The result is one of start_within_window, partial_overlap, outside_published_windows, or unknown, with an explicit cause_verified=False. Malformed, missing, wrong-date, out-of-order and overlapping schedules fail closed. Open events need a supplied observation boundary; Europe/Kyiv and midnight/DST cases are covered.

Validation

  • 25 new offline tests PASS.
  • Full isolated Docker suite: 484/484 PASS.
  • Ruff 0.14.2 formatting, E/F/I/UP/SIM, 79 columns and maintainability checker PASS.

Release boundaries

No network calls, Telegram writes, device controls, database changes or production deployment. This is a library-only Draft PR. Live integration depends on real, dated and verified schedule snapshots from draft PR #150, and separate emergency advisory normalization in draft PR #151. Operator confirmation of subscriber-facing text is required before release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant