Use entry ID when IPP printer offers no identifier (#34316)

This commit is contained in:
Chris Talkington authored and GitHub committed 2020-04-30 00:21:53 -07:00
1 parent f3c6f665af
commit b4083dc14f
4 files changed
+50 -19

No files matched your search

+12
View File
@@ -94,3 +94,15 @@ async def test_disabled_by_default_sensors(
assert entry
assert entry.disabled
assert entry.disabled_by == "integration"
async def test_missing_entry_unique_id(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
) -> None:
"""Test the unique_id of IPP sensor when printer is missing identifiers."""
entry = await init_integration(hass, aioclient_mock, uuid=None, unique_id=None)
registry = await hass.helpers.entity_registry.async_get_registry()
entity = registry.async_get("sensor.epson_xp_6000_series")
assert entity
assert entity.unique_id == f"{entry.entry_id}_printer"