Skip to content

refactor: move accessor from service to device#628

Closed
CFenner wants to merge 8 commits into
openviess:masterfrom
CFenner:accessor
Closed

refactor: move accessor from service to device#628
CFenner wants to merge 8 commits into
openviess:masterfrom
CFenner:accessor

Conversation

@CFenner

@CFenner CFenner commented Oct 21, 2025

Copy link
Copy Markdown
Member

Prep work for gateway-centric api calls

CFenner added a commit that referenced this pull request Jun 18, 2026
* refactor: move accessor from service to device

Splits the device-identity concern (installation/gateway/device IDs) from
the HTTP/cache concern (OAuth, request building, caching). Service
instances no longer hold an accessor — it lives on Device and
PyViCareDeviceConfig and is passed at each call site.

Prep work for a future gateway-scoped service that can serve multiple
devices from a single bulk fetch.

Picked up from CFenner's #628 on current master since the 8-month drift
(notably #764's PACKAGE_NOT_PAID_FOR exception handling in
ViCareCachedService) made a fresh implementation cleaner than the
rebase. Same design and API shape — public surface
(device.getProperty/setProperty, DeviceConfig.as*) is unchanged.

* fix(tests): cleanup mypy + pylint warnings in refactored test helpers

- ViCareDeviceAccessor takes int as first arg per its annotation; pass 0
  instead of "[id]" in the typed setUp of test_PyViCareDeviceConfig
- Rename intentionally-unused mock params to _-prefix (accessor,
  requested_roles) so pylint doesn't flag unused-argument

---------

Co-authored-by: Christopher Fenner <9592452+CFenner@users.noreply.github.com>
@CFenner CFenner closed this in #774 Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant