This commit is contained in:
J. Nick Koston
2025-12-23 01:01:20 -10:00
parent 0ec741c425
commit 89ef523990
3 changed files with 4 additions and 8 deletions
@@ -176,8 +176,7 @@ async def test_object_id_api_verification(
# === Test 3: Verify ALL entities can have object_id computed from API data ===
# This uses the algorithm from the PR summary that aioesphomeapi will use.
# NOTE: `name_add_mac_suffix` needs to be added to DeviceInfoResponse.
# For now, we infer it from the device name ending with MAC suffix.
# Infer name_add_mac_suffix from device name ending with MAC suffix.
mac_suffix = device_info.mac_address.replace(":", "")[-6:].lower()
name_add_mac_suffix = device_info.name.endswith(f"-{mac_suffix}")
@@ -73,8 +73,7 @@ async def test_object_id_friendly_name_no_mac_suffix(
assert named_entities[0].object_id == "temperature"
# Verify the full algorithm from PR summary works for ALL entities
# NOTE: `name_add_mac_suffix` needs to be added to DeviceInfoResponse.
# For now, we infer it from the device name ending with MAC suffix.
# Infer name_add_mac_suffix from device name ending with MAC suffix.
mac_suffix = device_info.mac_address.replace(":", "")[-6:].lower()
name_add_mac_suffix = device_info.name.endswith(f"-{mac_suffix}")
@@ -86,8 +86,7 @@ async def test_object_id_no_friendly_name_with_mac_suffix(
assert named_entities[0].object_id == "temperature"
# Verify the full algorithm from PR summary works for ALL entities
# NOTE: `name_add_mac_suffix` needs to be added to DeviceInfoResponse.
# For now, we infer it from the device name ending with MAC suffix.
# Infer name_add_mac_suffix from device name ending with MAC suffix.
mac_suffix = device_info.mac_address.replace(":", "")[-6:].lower()
name_add_mac_suffix = device_info.name.endswith(f"-{mac_suffix}")
@@ -167,8 +166,7 @@ async def test_object_id_no_friendly_name_no_mac_suffix(
assert named_entities[0].object_id == "temperature"
# Verify the full algorithm from PR summary works for ALL entities
# NOTE: `name_add_mac_suffix` needs to be added to DeviceInfoResponse.
# For now, we infer it from the device name ending with MAC suffix.
# Infer name_add_mac_suffix from device name ending with MAC suffix.
mac_suffix = device_info.mac_address.replace(":", "")[-6:].lower()
name_add_mac_suffix = device_info.name.endswith(f"-{mac_suffix}")