Report dosing pumps as support tier "dose" #3

Merged
r3pek merged 2 commits from gulaschcowboy/support-tier-dose into main 2026-11-12 09:25:00 +00:00 AGit
Contributor

Closes #2.

  • support_tier() returns "dose" for DoseV1 instead of "unsupported"; docstrings, get_device_summary() docs and the support tier table in 04-device-identity.md list it.
  • "dose" is read only for now, so nothing may treat it like a pump. The CLI's _load_schedule_from_file() used to write a pump schedule for anything that wasn't "light" (the support was only checked against the file), so a file saved with "support": "dose" would have reached a dosing pump. It now only writes for light and pump and raises otherwise, with a test. The other CLI schedule paths already used explicit light / pump branches.
  • CHANGELOG entry under Unreleased.

The ha-mobius side (schedule services as an allowlist) is a separate PR there. Tested on my two Versa pumps with a fork build: both report dose, lights and pumps unchanged. Same 7 BLE connection tests fail locally as on main.

Closes #2. - `support_tier()` returns `"dose"` for `DoseV1` instead of `"unsupported"`; docstrings, `get_device_summary()` docs and the support tier table in `04-device-identity.md` list it. - `"dose"` is read only for now, so nothing may treat it like a pump. The CLI's `_load_schedule_from_file()` used to write a pump schedule for anything that wasn't `"light"` (the support was only checked against the file), so a file saved with `"support": "dose"` would have reached a dosing pump. It now only writes for light and pump and raises otherwise, with a test. The other CLI schedule paths already used explicit `light` / `pump` branches. - CHANGELOG entry under Unreleased. The ha-mobius side (schedule services as an allowlist) is a separate PR there. Tested on my two Versa pumps with a fork build: both report `dose`, lights and pumps unchanged. Same 7 BLE connection tests fail locally as on `main`.
support_tier() returns "dose" for DoseV1 instead of "unsupported" (issue #2). Their schedule can't be written yet, so the CLI's schedule-file load now only writes for light and pump and refuses anything else instead of falling through to a pump schedule.
Gulaschcowboy force-pushed gulaschcowboy/support-tier-dose from 908e51129a to b4f39bee50 2026-11-12 09:11:19 +00:00 Compare
Owner

Thanks, this looks good, and thanks for catching the schedule-file load in the CLI. One thing before I merge:

get_device_summary() still calls dosing pumps unsupported. It now reports support: "dose", but a dosing pump still ends up in the last else branch, so the summary also gets the support note "PrimitiveType 'DoseV1' has no parser implemented here. Identity info only", which contradicts the new tier. Could you add a branch for it, e.g. elif poll.dose is not None: info["dose"] = asdict(poll.dose), and leave the note out there? Same thing as _fetch_all in ha-mobius PR 5.

Thanks, this looks good, and thanks for catching the schedule-file load in the CLI. One thing before I merge: **`get_device_summary()` still calls dosing pumps unsupported.** It now reports `support: "dose"`, but a dosing pump still ends up in the last `else` branch, so the summary also gets the support note "PrimitiveType 'DoseV1' has no parser implemented here. Identity info only", which contradicts the new tier. Could you add a branch for it, e.g. `elif poll.dose is not None: info["dose"] = asdict(poll.dose)`, and leave the note out there? Same thing as `_fetch_all` in ha-mobius PR 5.
A dosing pump fell through to the last branch and got the "no parser implemented" note, contradicting its "dose" tier. It now gets info["dose"] (the DoseInfo as a dict), like _fetch_all in ha-mobius.
Author
Contributor

Good catch, thanks! Done: get_device_summary() has an elif poll.dose is not None: branch now that adds info["dose"] = asdict(poll.dose) and leaves the support note out. The docstring lists "dose" for dosing pumps, and there's a test (test_get_device_summary_of_a_dosing_pump_has_dose_and_no_support_note) with a Versa that checks the support tier, the missing note and the dose values including the daily target from the schedule. It fails without the change. CHANGELOG entry updated too.

As in _fetch_all, a DoseV1 device whose dose attributes couldn't be read still gets the note.

Good catch, thanks! Done: `get_device_summary()` has an `elif poll.dose is not None:` branch now that adds `info["dose"] = asdict(poll.dose)` and leaves the support note out. The docstring lists `"dose"` for dosing pumps, and there's a test (`test_get_device_summary_of_a_dosing_pump_has_dose_and_no_support_note`) with a Versa that checks the support tier, the missing note and the dose values including the daily target from the schedule. It fails without the change. CHANGELOG entry updated too. As in `_fetch_all`, a `DoseV1` device whose dose attributes couldn't be read still gets the note.
r3pek merged commit 49a25dc3b1 into main 2026-11-12 09:25:00 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
r3pek/python-mobius!3
No description provided.