Skip to content

Expose explicit pet-to-device association management #23

Closed

Description

@Repsay

Current status (17 October 2026)

Association actions use fresh account/pet ownership, known binding state and exact Boolean/native integer request fields. A selected live association was changed and restored with matching readback. validate_associations.py now supports a scoped known-state roundtrip. Unrelated-binding preservation and invalid/foreign targets have regression tests.

Delivered: implementation/contracts and dedicated validation tooling. PR #43 consolidates the fixes, 666 passing tests on HA 2026.10.1/2026.3.0, strict mypy/Ruff and the coverage guide. This implementation ticket closes on merge; outstanding external acceptance is explicitly retained in #42, with #21/#22/#41 covering their separate work. Closing this ticket does not certify unperformed physical/app tests.

Historical audit and earlier development notes

The API client already has associate_pet, used when preserving bindings during weight updates, but users cannot explicitly inspect/change associations through documented integration actions.

APK evidence

view/tabs/device/device_setting/associated_pet/associated_pet_controller.dart: getPetList uses /device/get_associated_pets/ (0xc098f4); setAssociate uses /device/associate_pet (0xcc3e14).

Evidence source: NOTTY Smart Pet 1.1.30, SHA-256 3b6dc21037f2802e92233ecd9f685e76b03a79afa2d82dd52a5dfcd689a18e6a, decoded locally with Blutter. These are inspected request-construction paths, not just URL-string matches. Decoded app files and private captures remain outside the public repository.

Integration baseline

api.py at commit 9b1b7c3.

Acceptance criteria

  • Confirm association IDs, boolean/value types, account ownership and supported device kinds from the app.
  • Expose explicit associate/disassociate actions and clear current association readback.
  • Preserve unrelated pet bindings and physical-device identities.
  • Add synthetic multi-pet tests, including invalid targets and failed writes.

Distinct from closed #1: that issue preserved existing bindings; this requests deliberate association management.

Validation boundary

This is missing integration functionality backed by an app code path. Exact schemas, model support and live behavior still need verification before exposing writes.

No hardware actions or cloud-setting changes were performed while creating this issue.

Implementation update (2026-10-17)

Implemented in PR #39.

Adds notty.pet_association list/associate/disassociate actions. APK request encoding is integer physical/pet IDs and Boolean associate. Writes require an owned physical litter box and fresh owned-pet membership plus a known selected-device association state; unrelated bindings are not submitted. Pet profile edits preserve all is_bind=true device IDs and do not bind unbound candidates. Live association writes remain unverified.

Validation: 607 synthetic/mocked tests pass on HA 2026.10.1 and the exact minimum HA 2026.3.0; Ruff and strict mypy pass, including scripts. APK addresses and read/write boundaries are documented in docs/apk-pet-maintenance.md and docs/apk-firmware.md. No new cloud write, hardware operation, firmware install or statistics deletion was performed for this batch. Implementation is separate from live acceptance; this issue remains open for the outstanding validation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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