Skip to content

Only queue image uploads for sleeping deep-sleep displays#34

Merged
Misiu merged 4 commits into
deep_sleep__clean-portfrom
copilot/deep-sleep-clean-port
May 27, 2026
Merged

Only queue image uploads for sleeping deep-sleep displays#34
Misiu merged 4 commits into
deep_sleep__clean-portfrom
copilot/deep-sleep-clean-port

Conversation

Copilot AI commented May 27, 2026

Copy link
Copy Markdown

Queued image delivery was being triggered whenever a display was not connectable, even if the device did not use deep sleep. This change narrows queuing to the intended case: a deep-sleep-capable display that is currently asleep; all other displays upload immediately.

  • Behavior change

    • Gate deep-sleep queuing on deep_sleep_time_seconds > 0.
    • Preserve the existing wake-up flush path for queued uploads when a sleeping display becomes connectable again.
    • Stop applying the fallback expiry path to devices that do not advertise deep sleep support.
  • Why this matters

    • Non-deep-sleep devices should not defer uploads just because they are temporarily not connectable.
    • The queue now represents exactly one state: “device is sleeping and expected to wake within its configured deep-sleep window.”
  • Test updates

    • Replace the zero-deep-sleep fallback test with coverage for immediate upload when deep sleep is unsupported.
    • Keep the existing queued-upload expiry and wake-up behavior unchanged for actual deep-sleep devices.
deep_sleep_seconds = entry.runtime_data.device_config.power.deep_sleep_time_seconds
if (
    async_ble_device_from_address(hass, address, connectable=True) is None
    and deep_sleep_seconds > 0
):
    # queue for wake-up

Copilot AI changed the title Remove options flow: derive deep-sleep queue expiry from device config Rename deep-sleep queued item and add deterministic expiry purge May 27, 2026
Copilot finished work on behalf of Misiu May 27, 2026 07:58
Copilot AI requested a review from Misiu May 27, 2026 07:58
Copilot AI changed the title Rename deep-sleep queued item and add deterministic expiry purge Only queue image uploads for sleeping deep-sleep displays May 27, 2026
Copilot finished work on behalf of Misiu May 27, 2026 08:11
@Misiu Misiu marked this pull request as ready for review May 27, 2026 08:16
@Misiu Misiu merged commit 1df5902 into deep_sleep__clean-port May 27, 2026
2 checks passed
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.

2 participants