From 1e6ac436438a20d3bf92ea49618ad1ec51fc24a9 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 9 Sep 2024 08:15:31 +0200 Subject: [PATCH] wid/hap: handle both HAS and IAS discovery in hdl_wid_20103 --- autopts/wid/hap.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/autopts/wid/hap.py b/autopts/wid/hap.py index 557f050beb..35f6c41ac7 100644 --- a/autopts/wid/hap.py +++ b/autopts/wid/hap.py @@ -225,9 +225,9 @@ def hdl_wid_20100(_: WIDParams): return True -def hdl_wid_20103(_: WIDParams): +def hdl_wid_20103(params: WIDParams): """ - Please take action to discover the Alert Level characteristic from the Immediate Alert. + Please take action to discover the X Control Point characteristic from the Y. Discover the primary service if needed. Description: Verify that the Implementation Under Test (IUT) can send Discover All Characteristics command. """ @@ -235,8 +235,13 @@ def hdl_wid_20103(_: WIDParams): addr_type = pts_addr_type_get() stack = get_stack() - btp.hap_iac_discover(addr_type, addr) - stack.hap.wait_iac_discovery_complete_ev(addr_type, addr, 30) + # Pick Service to discover by description text + if 'Alert Level' in params.description: + btp.hap_iac_discover(addr_type, addr) + stack.hap.wait_iac_discovery_complete_ev(addr_type, addr, 30) + else: + btp.hap_hauc_discover(addr_type, addr) + stack.hap.wait_hauc_discovery_complete_ev(addr_type, addr, 30) return True