1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-25 13:38:04 +00:00
Files
core/tests/components/snoo/__init__.py
Luke Lashley 571349e3a2 Add Snoo integration (#134243)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2025-02-24 13:45:10 +01:00

39 lines
1.0 KiB
Python

"""Tests for the Happiest Baby Snoo integration."""
from homeassistant.components.snoo.const import DOMAIN
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
def create_entry(
hass: HomeAssistant,
) -> ConfigEntry:
"""Add config entry in Home Assistant."""
entry = MockConfigEntry(
domain=DOMAIN,
title="test-username",
data={
CONF_USERNAME: "test-username",
CONF_PASSWORD: "sample",
},
# This is also gotten from the fake jwt
unique_id="123e4567-e89b-12d3-a456-426614174000",
version=1,
)
entry.add_to_hass(hass)
return entry
async def async_init_integration(hass: HomeAssistant) -> ConfigEntry:
"""Set up the Snoo integration in Home Assistant."""
entry = create_entry(hass)
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
return entry