Lift a Deadlines helper, unify the (node, index) Key #94
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/deadlines-and-key-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Four small, independent cleanups in readings/reading_store/alarms/coordinator:
ReadingStore._rearm/_cancelandAlarmStore._arm/_cancelwere the same generic deadline dict twice over. Lifted into aDeadlineshelper inreadings.py; both stores'async_stopis nowcancel_all().CampervanCoordinator.__init__registered six frame listeners and six availability listeners one call at a time; replaced with two loops over a tuple of stores, keeping traffic first.Key = tuple[int, int]was defined separately inreading_store.pyandplatforms.py, and alarms.py reused the same name for an unrelated three-tuple. Defined once inreadings.py, imported where needed, and renamed alarms' toAlarmKey._changedwrappers in both stores, since nothing patches them.Tested with the existing suite (
tools/checkequivalent: ruff, mypy, pytest), all green, no behaviour change.Clean. Each of the four commits does exactly what it claims and nothing more, scoped to the five files agreed.
Checked and confirmed:
Deadlines.arm()cancels any existing timer before starting a new one, matching the old_rearm/_armbehaviour exactly._absence: Deadlines[int]and_staleness: Deadlines[Key]are separate instances with their own dicts, no cross-leakage._rearm,_cancel,_armor_changed— grepped the suite, nothing references them.async_bus_availability_changedhandlers read another store's state, so this reordering has no observable effect.AlarmKeyrename is complete — no leftover references to a bareKeyin alarms.py, and the unifiedKey = tuple[int, int]in readings.py is used consistently by reading_store.py and platforms.py.Nothing to flag.
2973a849b8f76a319545