Skip to content

Lower MINIMUM_SCHEDULES_INTERVAL_MINUTES from 10 to 5 #57

@simons-plugins

Description

@simons-plugins

Problem

validators.py rejects schedulesInterval < 10 via MINIMUM_SCHEDULES_INTERVAL_MINUTES = 10 in constants.py. Other polling intervals have minimums of 5 (MINIMUM_DEVICE_INFO_INTERVAL_MINUTES, MINIMUM_MOISTURES_INTERVAL_MINUTES) or even 3 (MINIMUM_EVENTS_INTERVAL_MINUTES). The 10-min floor on schedules prevents users from getting zone state updates (isIrrigating, lastWateringStart, etc.) any faster than every 10 minutes, which causes perceptible UX lag after manual actions (see #).

Proposed fix

In constants.py, change MINIMUM_SCHEDULES_INTERVAL_MINUTES from 10 to 5. That brings it in line with moistures and device-info minimums. The validator logic is unchanged — it picks up the new constant automatically.

No test changes required (the existing validators.py tests validate behaviour, not the constant value).

Token budget impact

Netro v2 API has a daily token budget. /schedules.json costs 1 token per call. Moving from 10 → 5 min means 288 calls/day instead of 144 — an extra 144 tokens. Default v2 quota is 2000/day, so this is an acceptable 7% increase for users who opt in. Users who don't change the default (30 min) are unaffected.

Acceptance

  • MINIMUM_SCHEDULES_INTERVAL_MINUTES = 5 in constants.py.
  • Config UI accepts a value of 5 in schedulesInterval.
  • Validator rejects 4 (still below new minimum).
  • Release notes / README note the change so users know the tighter polling is available.

Out of scope

  • Per-endpoint token budget warnings in the plugin UI.
  • Auto-tuning the interval based on observed token-reset patterns.

Context

Surfaced during PR #55 dogfooding — user tried schedulesInterval = 5 in prefs and hit the floor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions