1
0
mirror of https://github.com/home-assistant/core.git synced 2026-07-02 12:17:30 +01:00
Files
core/homeassistant/components/kitchen_sink/device.py
T
2026-04-30 21:14:48 +02:00

26 lines
756 B
Python

"""Create device without entities."""
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr
from . import DOMAIN
def async_create_device(
hass: HomeAssistant,
config_entry_id: str,
device_name: str | None,
device_translation_key: str | None,
device_translation_placeholders: dict[str, str] | None,
unique_id: str,
) -> dr.DeviceEntry:
"""Create a device."""
device_registry = dr.async_get(hass)
return device_registry.async_get_or_create(
config_entry_id=config_entry_id,
identifiers={(DOMAIN, unique_id)},
name=device_name,
translation_key=device_translation_key,
translation_placeholders=device_translation_placeholders,
)