Skip to content

Expose an explicit device-statistics reset action #26

Closed

Description

@Repsay

Current status (17 October 2026)

The explicitly confirmed owner-device statistics action, scoped empty-object POST contract, refresh and synthetic tests are implemented. validate_statistics.py provides a dedicated before/after run. No history was deleted during development; the exact affected counters/history must be observed only when deletion is wanted, as tracked in #42.

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 endpoint is listed internally but is absent from public actions. The app exposes statistics clearing, which is distinct from resetting device weight or reminder timers.

APK evidence

view/tabs/device/device_setting/setting/setting_controller.dart, SettingController::cleanStatistics, selects /device/clear_statistics/ at 0xcc9c08.

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

  • Determine exactly which data/counters are cleared and establish the required payload and ownership rules.
  • Expose a clearly named, explicitly invoked action only for supported physical devices.
  • Document the reset scope and refresh affected sensors without changing unrelated settings.
  • Test request targeting and reset-state handling with synthetic data; do not call it automatically during probes or setup.

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.clear_statistics with a required confirm_irreversible: true field and owned physical-litter-box targeting. Further tracing establishes POST /device/clear_statistics/{physicalID} with an empty object body, followed by coordinator refresh. No automatic probe/setup call exists. APK warns deletion is irreversible; exact counters/history removed remain unverified, so keep this issue open for an owner-requested deletion and before/after evidence.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions