Skip to content

Add Xiaomi Smart Pet Fountain 2 support#2069

Open
JanOstrowka wants to merge 5 commits intorytilahti:masterfrom
JanOstrowka:codex/pet-fountain-xiaomi-miio
Open

Add Xiaomi Smart Pet Fountain 2 support#2069
JanOstrowka wants to merge 5 commits intorytilahti:masterfrom
JanOstrowka:codex/pet-fountain-xiaomi-miio

Conversation

@JanOstrowka
Copy link
Copy Markdown

Summary

  • add first-class python-miio support for Xiaomi Smart Pet Fountain 2 (xiaomi.pet_waterer.70m2)
  • expose a dedicated MIOT device class, typed status enums, and control methods
  • include tests for the main controls and missing-value handling

Why

Home Assistant core review requested that the pet fountain implementation live in the library used by the integration instead of being carried as a local helper in xiaomi_miio.

Included

  • XiaomiPetFountain device class
  • status model for fountain status, water mode, charging state, DND times, battery, filter metrics, and fault state
  • control methods for mode, water interval, child lock, do not disturb, DND start/end, and filter reset
  • export from miio.__init__
  • README supported-device entry

Related

Validation

  • python3 -m py_compile on the new pet fountain package and tests
  • the equivalent entity model and control flow were exercised against a real device from the Home Assistant side while iterating on the integration support

I was not able to run the full pytest suite in this environment because pytest is not installed locally.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.48%. Comparing base (c5cc0f2) to head (92c310b).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2069      +/-   ##
==========================================
+ Coverage   82.26%   82.48%   +0.21%     
==========================================
  Files         197      201       +4     
  Lines       19145    19381     +236     
  Branches     1052     1060       +8     
==========================================
+ Hits        15750    15986     +236     
  Misses       3218     3218              
  Partials      177      177              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JanOstrowka
Copy link
Copy Markdown
Author

I split the Read the Docs cleanup into a dedicated follow-up PR: #2070.

That PR fixes the warning sources causing the RTD build to fail on Python 3.9 / Sphinx 7.4.7, and I verified it locally with:

/tmp/python-miio-rtd-rtd/bin/sphinx-build -b html -W docs /tmp/python-miio-rtd-rtd74-html

So the remaining RTD failure on this feature PR should be addressable independently of the pet fountain implementation.

@JanOstrowka JanOstrowka marked this pull request as ready for review March 30, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant