Skip to content

Support homeId in me response - #331

Merged
wmalgadey merged 1 commit into
wmalgadey:masterfrom
lin-hongkuan:codex/support-home-id-me-response
Jun 28, 2026
Merged

Support homeId in me response#331
wmalgadey merged 1 commit into
wmalgadey:masterfrom
lin-hongkuan:codex/support-home-id-me-response

Conversation

@lin-hongkuan

Copy link
Copy Markdown

Some Tado accounts now return a homeId field from the me endpoint instead of a homes array. In that case device activation fails while _get_id indexes response["homes"], which blocks Home Assistant's Tado config flow.

This keeps the existing homes[0].id path and adds a homeId fallback before raising a clear TadoException for unexpected responses.

Related Home Assistant issue: home-assistant/core#165689

Validation:

  • python -m pytest tests\test_http.py -q
  • python -m pytest -q
  • python -m ruff check PyTado\http.py --line-length=100
  • python -m flake8 PyTado\http.py --max-line-length=100
  • python -m black --check PyTado\http.py tests\test_http.py
  • python -m bandit -c pyproject.toml PyTado\http.py

Note: python -m mypy PyTado tests still reports existing repository-wide typing issues, including missing requests stubs and unannotated test functions; the new code path did not add errors in PyTado/http.py.

@codecov

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.11%. Comparing base (889900e) to head (fe87e93).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
PyTado/http.py 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #331      +/-   ##
==========================================
- Coverage   76.16%   76.11%   -0.05%     
==========================================
  Files          37       37              
  Lines        2207     2211       +4     
  Branches      134      136       +2     
==========================================
+ Hits         1681     1683       +2     
- Misses        485      486       +1     
- Partials       41       42       +1     

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wmalgadey
wmalgadey merged commit eec3987 into wmalgadey:master Jun 28, 2026
8 of 10 checks passed
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.

2 participants