Map remaining coverage-gap hrefs, fix discover() false-gap bug, improve device naming
Maps the fridge/dishwasher hrefs flagged by last session's coverage-gap Repairs issue: defrost delay (switch) + block status (diagnostic binary sensor), master ice-maker enable, self-check trigger/status, dishwasher diagnosis trigger/status, and last-operation-source. Adds fallback capabilities for /doors, /temperatures, and /icemaker/status that only bind when the richer per-instance hrefs they duplicate are absent, so simpler devices without those hrefs still get the data. Everything else in the original gap list moves to capabilities.ignored (Bixby audio feedback, inert DR/energy-planner resources, redundant metadata). Fixes discover() reporting a known href as an unregistered gap whenever its match_fn declined to bind for that device (e.g. a filter capability on hardware without that filter) — it's now only a gap when no capability is registered for the href at all. Device naming now uses x.com.samsung.da.modelNum (not the OCF /oic/p,d metadata, which produced inconsistent names like "[dishwasher] Samsung") to build "Samsung <Type> (<model>)".
This commit is contained in:
1 parent
d2699f0f5b
commit
5d1a32aa9a
13 files changed
+279
-23
No files matched your search
@@ -79,30 +79,34 @@ async def test_update_failed_on_persistent_poll_error(
|
||||
# Coverage-gap detection and the Repairs issue it raises
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
async def test_discovery_populates_device_type_and_unbound_hrefs(
|
||||
async def test_discovery_populates_device_type_with_no_unbound_hrefs(
|
||||
hass: HomeAssistant, mock_entry, mock_coordinator_session
|
||||
) -> None:
|
||||
"""The real refrigerator fixture is a recognized type with some gaps left."""
|
||||
"""The real refrigerator fixture is a recognized type, fully covered.
|
||||
|
||||
Every href in this fixture is either mapped to a capability or listed
|
||||
in capabilities.ignored — see tests/test_registry_ignored.py for the
|
||||
noise-suppression checks. If this starts failing because a genuinely
|
||||
new gap appeared, map it or ignore it rather than deleting the assertion.
|
||||
"""
|
||||
await hass.config_entries.async_setup(mock_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
coordinator: LocalThingsCoordinator = hass.data[DOMAIN][mock_entry.entry_id]
|
||||
assert coordinator.device_type_name == 'refrigerator'
|
||||
assert coordinator.one_ui_version == '7.0 Refrigerator'
|
||||
# Real, currently-unmodeled hrefs on this fixture (not noise — see
|
||||
# tests/test_registry_ignored.py for the noise-suppression checks).
|
||||
assert '/bespoke/vs/0' in coordinator._unbound_hrefs
|
||||
assert coordinator._unbound_hrefs == []
|
||||
|
||||
|
||||
async def test_coverage_gap_issue_created_for_real_fixture_gaps(
|
||||
async def test_coverage_gap_issue_absent_for_fully_covered_real_fixture(
|
||||
hass: HomeAssistant, mock_entry, mock_coordinator_session
|
||||
) -> None:
|
||||
"""A recognized device with leftover unbound hrefs still raises the issue."""
|
||||
"""A recognized device with no unbound hrefs does not raise the issue."""
|
||||
await hass.config_entries.async_setup(mock_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
issue_id = f"device_gap_{mock_entry.entry_id}"
|
||||
assert ir.async_get(hass).async_get_issue(DOMAIN, issue_id) is not None
|
||||
assert ir.async_get(hass).async_get_issue(DOMAIN, issue_id) is None
|
||||
|
||||
|
||||
def test_update_coverage_gap_issue_creates_issue_for_unknown_type(
|
||||
|
||||
@@ -18,7 +18,7 @@ async def test_diagnostics_shape_and_redaction(
|
||||
|
||||
assert diagnostics["device_type"] == 'refrigerator'
|
||||
assert diagnostics["one_ui_version"] == '7.0 Refrigerator'
|
||||
assert '/bespoke/vs/0' in diagnostics["unbound_hrefs"]
|
||||
assert diagnostics["unbound_hrefs"] == []
|
||||
assert diagnostics["integration_version"] == '0.1.0'
|
||||
assert diagnostics["smartthings_local_version"]
|
||||
|
||||
|
||||
Reference in new issue
Block a user