mirror of
https://github.com/esphome/esphome.git
synced 2026-09-17 01:58:39 +00:00
tweak
This commit is contained in:
@@ -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}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user