Skip to content

[Bug]: Cleaning Reset / Filter Reset buttons fail with "'dict' object has no attribute 'json'" #258

Description

@ruppi84

What happened ?

I would like to briefly thank you for the solutions you have provided so far.

Pressing the Cleaning Reset or Filter Reset button on a Dockstream Smart Fountain (PLWF105) fails every time with an AttributeError, instead of resetting the counter.

Expected: the reset counter updates on the device, no error.
Actual: both buttons raise 'dict' object has no attribute 'json'.

Likely related to #200 (closed via #201) — request() returning a plain dict depending on token refresh. That fix doesn't appear to cover set_cleaning_reset and set_filter_reset in api.py (lines 1329 and 1363), which still call .json() on a value that's already a parsed dict. Flagging as a probable follow-up to #201 rather than a duplicate.

Environment: Integration v1.2.32 (latest, no pending update), Home Assistant Core 2026.8.1, Home Assistant OS 18.2, Raspberry Pi 5. Device: PETLIBRO Dockstream Smart Fountain, model PLWF105, hardware 1.0.1, firmware 1.1.11.

Relevant log output

Error pressing button Cleaning Reset for device Cat Brunnen: 'dict' object has no attribute 'json'
Traceback (most recent call last):
  File "/config/custom_components/petlibro/button.py", line 839, in async_press
    await desc.set_fn(self.device)
  File "/config/custom_components/petlibro/devices/fountains/dockstream_smart_fountain.py", line 232, in set_cleaning_reset
    await self.api.set_cleaning_reset(self.serial)
  File "/config/custom_components/petlibro/api.py", line 1329, in set_cleaning_reset
    response_data = await response.json()
                          ^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'json'

Error pressing button Filter Reset for device Cat Brunnen: 'dict' object has no attribute 'json'
Traceback (most recent call last):
  File "/config/custom_components/petlibro/button.py", line 839, in async_press
    await desc.set_fn(self.device)
  File "/config/custom_components/petlibro/devices/fountains/dockstream_smart_fountain.py", line 241, in set_filter_reset
    await self.api.set_filter_reset(self.serial)
  File "/config/custom_components/petlibro/api.py", line 1363, in set_filter_reset
    response_data = await response.json()
                          ^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'json'

Metadata

Metadata

Assignees

Labels

BugSomething isn't working

Projects

Status
To triage

Relationships

None yet

Development

No branches or pull requests

Issue actions