1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-27 14:31:13 +00:00

Use full serial number when adding an Airthings device (#153499)

This commit is contained in:
Ståle Storø Hauknes
2025-10-05 15:23:02 +02:00
committed by GitHub
parent 618fe81207
commit 2b370a0eca
2 changed files with 7 additions and 7 deletions

View File

@@ -44,7 +44,7 @@ def get_name(device: AirthingsDevice) -> str:
name = device.friendly_name()
if identifier := device.identifier:
name += f" ({identifier})"
name += f" ({device.model.value}{identifier})"
return name

View File

@@ -47,7 +47,7 @@ async def test_bluetooth_discovery(hass: HomeAssistant) -> None:
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "bluetooth_confirm"
assert result["description_placeholders"] == {
"name": "Airthings Wave Plus (123456)"
"name": "Airthings Wave Plus (2930123456)"
}
with patch_async_setup_entry():
@@ -56,7 +56,7 @@ async def test_bluetooth_discovery(hass: HomeAssistant) -> None:
)
await hass.async_block_till_done()
assert result["type"] is FlowResultType.CREATE_ENTRY
assert result["title"] == "Airthings Wave Plus (123456)"
assert result["title"] == "Airthings Wave Plus (2930123456)"
assert result["result"].unique_id == "cc:cc:cc:cc:cc:cc"
@@ -136,7 +136,7 @@ async def test_user_setup(hass: HomeAssistant) -> None:
schema = result["data_schema"].schema
assert schema.get(CONF_ADDRESS).container == {
"cc:cc:cc:cc:cc:cc": "Airthings Wave Plus (123456)"
"cc:cc:cc:cc:cc:cc": "Airthings Wave Plus (2930123456)"
}
with patch(
@@ -149,7 +149,7 @@ async def test_user_setup(hass: HomeAssistant) -> None:
await hass.async_block_till_done()
assert result["type"] is FlowResultType.CREATE_ENTRY
assert result["title"] == "Airthings Wave Plus (123456)"
assert result["title"] == "Airthings Wave Plus (2930123456)"
assert result["result"].unique_id == "cc:cc:cc:cc:cc:cc"
@@ -186,7 +186,7 @@ async def test_user_setup_replaces_ignored_device(hass: HomeAssistant) -> None:
schema = result["data_schema"].schema
assert schema.get(CONF_ADDRESS).container == {
"cc:cc:cc:cc:cc:cc": "Airthings Wave Plus (123456)"
"cc:cc:cc:cc:cc:cc": "Airthings Wave Plus (2930123456)"
}
with patch(
@@ -199,7 +199,7 @@ async def test_user_setup_replaces_ignored_device(hass: HomeAssistant) -> None:
await hass.async_block_till_done()
assert result["type"] is FlowResultType.CREATE_ENTRY
assert result["title"] == "Airthings Wave Plus (123456)"
assert result["title"] == "Airthings Wave Plus (2930123456)"
assert result["result"].unique_id == "cc:cc:cc:cc:cc:cc"