Skip to content

Add descriptors to all remaining integrations#2066

Merged
rytilahti merged 7 commits into
rytilahti:masterfrom
Acrobot:add-descriptors
Jul 5, 2026
Merged

Add descriptors to all remaining integrations#2066
rytilahti merged 7 commits into
rytilahti:masterfrom
Acrobot:add-descriptors

Conversation

@Acrobot

@Acrobot Acrobot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Adds @sensor and @setting decorators to all 44 integration files that previously lacked them. The only integration without static descriptors is genericmiot, which gets its descriptors dynamically from miotspec files.

This brings descriptor coverage from ~12 to ~56 integrations (~550 properties decorated), enabling Home Assistant and other downstream consumers to automatically discover sensors, settings, icons, units, and device classes without per-device hardcoding.

Decorated integrations include: air purifiers (zhimi, airdog), vacuums (dreame, roidmi, g1), fans (dmaker, leshow, zhimi), humidifiers (deerma, shuii), heaters (zhimi), lights (philips, huizuo, ceil), plugs (chuangmi), water purifiers (yunmi), air conditioners (xiaomi, lumi), cameras (chuangmi, aqara), curtains (lumi), air monitors (cgllc), dehumidifiers (nwt), cookers (chunmi), pet dispensers (mmgg), dishwashers (viomi), walkingpads (ksmb), toiletlids (tinymu), relays (pwzn), clocks (zimi), repeaters (xiaomi), speakers (xiaomi), and dual switches (yeelight).

Full test suite: 1286 passed (same as master), no new failures. Ruff clean.

Closes #1617

@Acrobot

Acrobot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor Author

These changes were generated using Claude Code under my supervision. I reviewed and approved all code before submitting. I'm not very familiar with this codebase, so apologies in advance for any mistakes.

@Acrobot Acrobot marked this pull request as ready for review March 27, 2026 00:51
@Acrobot Acrobot mentioned this pull request Mar 27, 2026
22 tasks
@rytilahti

Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts in this pull request

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.04913% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.13%. Comparing base (c8ed9a5) to head (59f8f22).

Files with missing lines Patch % Lines
miio/integrations/zimi/clock/alarmclock.py 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2066      +/-   ##
==========================================
+ Coverage   83.64%   84.13%   +0.48%     
==========================================
  Files         199      199              
  Lines       19537    20164     +627     
  Branches     1063     1063              
==========================================
+ Hits        16341    16964     +623     
- Misses       3006     3010       +4     
  Partials      190      190              

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

@rytilahti rytilahti left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Acrobot and thanks for the PR!

It is a great step forward, I applied a couple of changes:

  • Dropping icon and device_class, as these are not necessary for now
  • Removing the decoration for one-way actions.

The latter requires some thought to make the interface consistent among integrations, but it can be done in a separate PR.

Acrobot and others added 7 commits July 5, 2026 16:11
Adds introspectable interface decorators to 44 integration files that
previously lacked them, bringing descriptor coverage from ~12 to ~56
integrations. This enables downstream consumers like Home Assistant to
automatically discover available sensors, settings, and their metadata
(icons, units, device classes) without hardcoding per-device knowledge.

Addresses rytilahti#1617
The decorator order was @Property then @sensor/@setting (correct), but
blank lines were misplaced between them. Run ruff format on all changed
files to fix spacing.
@rytilahti rytilahti merged commit 2817647 into rytilahti:master Jul 5, 2026
14 checks passed
@Acrobot Acrobot deleted the add-descriptors branch July 8, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[meta] Add descriptors to existing integrations

3 participants