Report dosing pumps as support tier "dose" #3
Loading…
Reference in a new issue
No description provided.
Delete branch "gulaschcowboy/support-tier-dose"
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?
Closes #2.
support_tier()returns"dose"forDoseV1instead of"unsupported"; docstrings,get_device_summary()docs and the support tier table in04-device-identity.mdlist 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 explicitlight/pumpbranches.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 onmain.908e51129atob4f39bee50Thanks, 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 reportssupport: "dose", but a dosing pump still ends up in the lastelsebranch, 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_allin ha-mobius PR 5.Good catch, thanks! Done:
get_device_summary()has anelif poll.dose is not None:branch now that addsinfo["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, aDoseV1device whose dose attributes couldn't be read still gets the note.