mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 15:57:06 +00:00
Remove name from device info in devolo Home Network (#102585)
This commit is contained in:
parent
9c0427a7ac
commit
04c0bca487
@ -52,7 +52,6 @@ class DevoloEntity(Entity):
|
|||||||
identifiers={(DOMAIN, str(device.serial_number))},
|
identifiers={(DOMAIN, str(device.serial_number))},
|
||||||
manufacturer="devolo",
|
manufacturer="devolo",
|
||||||
model=device.product,
|
model=device.product,
|
||||||
name=entry.title,
|
|
||||||
serial_number=device.serial_number,
|
serial_number=device.serial_number,
|
||||||
sw_version=device.firmware_version,
|
sw_version=device.firmware_version,
|
||||||
)
|
)
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
# serializer version: 1
|
||||||
|
# name: test_setup_entry
|
||||||
|
DeviceRegistryEntrySnapshot({
|
||||||
|
'area_id': None,
|
||||||
|
'config_entries': <ANY>,
|
||||||
|
'configuration_url': 'http://192.0.2.1',
|
||||||
|
'connections': set({
|
||||||
|
}),
|
||||||
|
'disabled_by': None,
|
||||||
|
'entry_type': None,
|
||||||
|
'hw_version': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'identifiers': set({
|
||||||
|
tuple(
|
||||||
|
'devolo_home_network',
|
||||||
|
'1234567890',
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
'is_new': False,
|
||||||
|
'manufacturer': 'devolo',
|
||||||
|
'model': 'dLAN pro 1200+ WiFi ac',
|
||||||
|
'name': 'Mock Title',
|
||||||
|
'name_by_user': None,
|
||||||
|
'serial_number': '1234567890',
|
||||||
|
'suggested_area': None,
|
||||||
|
'sw_version': '5.6.1',
|
||||||
|
'via_device_id': None,
|
||||||
|
})
|
||||||
|
# ---
|
@ -3,6 +3,7 @@ from unittest.mock import patch
|
|||||||
|
|
||||||
from devolo_plc_api.exceptions.device import DeviceNotFound
|
from devolo_plc_api.exceptions.device import DeviceNotFound
|
||||||
import pytest
|
import pytest
|
||||||
|
from syrupy.assertion import SnapshotAssertion
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR
|
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR
|
||||||
from homeassistant.components.button import DOMAIN as BUTTON
|
from homeassistant.components.button import DOMAIN as BUTTON
|
||||||
@ -15,6 +16,7 @@ from homeassistant.components.update import DOMAIN as UPDATE
|
|||||||
from homeassistant.config_entries import ConfigEntryState
|
from homeassistant.config_entries import ConfigEntryState
|
||||||
from homeassistant.const import CONF_IP_ADDRESS, EVENT_HOMEASSISTANT_STOP
|
from homeassistant.const import CONF_IP_ADDRESS, EVENT_HOMEASSISTANT_STOP
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers import device_registry as dr
|
||||||
from homeassistant.helpers.entity_platform import async_get_platforms
|
from homeassistant.helpers.entity_platform import async_get_platforms
|
||||||
|
|
||||||
from . import configure_integration
|
from . import configure_integration
|
||||||
@ -24,17 +26,23 @@ from .mock import MockDevice
|
|||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("mock_device")
|
async def test_setup_entry(
|
||||||
async def test_setup_entry(hass: HomeAssistant) -> None:
|
hass: HomeAssistant,
|
||||||
|
mock_device: MockDevice,
|
||||||
|
device_registry: dr.DeviceRegistry,
|
||||||
|
snapshot: SnapshotAssertion,
|
||||||
|
) -> None:
|
||||||
"""Test setup entry."""
|
"""Test setup entry."""
|
||||||
entry = configure_integration(hass)
|
entry = configure_integration(hass)
|
||||||
with patch(
|
|
||||||
"homeassistant.config_entries.ConfigEntries.async_forward_entry_setup",
|
|
||||||
return_value=True,
|
|
||||||
), patch("homeassistant.core.EventBus.async_listen_once"):
|
|
||||||
assert await hass.config_entries.async_setup(entry.entry_id)
|
assert await hass.config_entries.async_setup(entry.entry_id)
|
||||||
|
await hass.async_block_till_done()
|
||||||
assert entry.state is ConfigEntryState.LOADED
|
assert entry.state is ConfigEntryState.LOADED
|
||||||
|
|
||||||
|
device_info = device_registry.async_get_device(
|
||||||
|
{(DOMAIN, mock_device.serial_number)}
|
||||||
|
)
|
||||||
|
assert device_info == snapshot
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("mock_device")
|
@pytest.mark.usefixtures("mock_device")
|
||||||
async def test_setup_without_password(hass: HomeAssistant) -> None:
|
async def test_setup_without_password(hass: HomeAssistant) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user