Skip to content

genericmiot: add metadata command and cgllc-spec namespace - #2088

Merged
rytilahti merged 11 commits into
masterfrom
feat/cgllc-namespace
Jul 25, 2026
Merged

genericmiot: add metadata command and cgllc-spec namespace#2088
rytilahti merged 11 commits into
masterfrom
feat/cgllc-namespace

Conversation

@rytilahti

@rytilahti rytilahti commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Add new CLI command to allow generating a metadata file for an unsupported device, and use it to add support for cgllc-spec used by Qingping air quality monitor lite (cgllc.airm.cgd1st).

  • Refactor metadata lookup to use an implicit fallback chain (device namespace -> miot-spec-v2 -> common), with the source namespace set on the returned result so callers can see where a match came from
  • Add a metadata CLI command to GenericMiot that reports per-entity coverage ([ok]/[fb]/[??]/[--]) and can generate or merge namespace metadata YAML files for missing entries; entries without a description are listed at the end of each service block so gaps are easy to spot
  • Allow description to be omitted on property and action metadata entries, keeping them registered without overriding the device-given name
  • Add cgllc-spec namespace metadata for cgllc.airm.cgd1st with human-readable descriptions for known settings and placeholder entries for unclear ones

Unify the lookup API so get_metadata returns the source namespace on the
result, removing the need for a separate paired method.
Make the miot-spec-v2 -> common fallback implicit for all namespaces,
dropping the per-namespace fallback field from the YAML files.
Adds a 'metadata' command that reports per-entity coverage against the
loaded namespace metadata, distinguishing direct hits from fallbacks.
Missing items can be saved as YAML stubs, which are merged into existing
namespace files and automatically registered in the index.
Known settings get human-readable descriptions; entries with unclear
purpose use empty entries to stay registered without name overrides.
@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.30769% with 51 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.31%. Comparing base (34dd0e9) to head (b040b12).

Files with missing lines Patch % Lines
miio/integrations/genericmiot/genericmiot.py 15.38% 44 Missing ⚠️
miio/miot_models.py 33.33% 4 Missing ⚠️
miio/integrations/genericmiot/meta.py 97.45% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2088      +/-   ##
==========================================
- Coverage   84.35%   84.31%   -0.04%     
==========================================
  Files         201      201              
  Lines       20377    20656     +279     
  Branches     1079     1121      +42     
==========================================
+ Hits        17188    17417     +229     
- Misses       2999     3047      +48     
- Partials      190      192       +2     

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

@rytilahti
rytilahti merged commit 9a00e08 into master Jul 25, 2026
13 of 14 checks passed
@rytilahti
rytilahti deleted the feat/cgllc-namespace branch July 25, 2026 16:54
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.

1 participant