test(ha_adb_common,connection): application-label tolerance (dual quotes, empty multi-label blocks, null, absent) + label cache reuse across cycles — no duplicate pm dump (P5-1)
This commit is contained in:
1 parent
2e6dfd8981
commit
c57a2e2ff2
5 files changed
+204
-1
No files matched your search
@@ -392,6 +392,21 @@ class ShieldConnectionManager:
|
||||
"""
|
||||
return self._protocol is not None
|
||||
|
||||
async def async_protocol_device_info(self) -> tuple[str, str] | None:
|
||||
"""(device name, MAC) via the protocol client (P5-1 migration).
|
||||
|
||||
None when the transport is absent or the lookup fails — callers
|
||||
fall back to the config-entry id.
|
||||
"""
|
||||
if self._protocol is None:
|
||||
return None
|
||||
with contextlib.suppress(Exception):
|
||||
name, mac = await asyncio.wait_for(
|
||||
self._protocol.async_get_name_and_mac(), timeout=10
|
||||
)
|
||||
return name, mac
|
||||
return None
|
||||
|
||||
@property
|
||||
def adb_poller(self):
|
||||
"""The ADB poller (or None) — public accessor replacing the
|
||||
|
||||
Reference in new issue
Block a user