Files
ha-core/tests/components/whirlpool/__init__.py
Jessica Smith 02c1088596 Upgrade whirlpool integration to add shared appliances and allow brand selection (#111687)
* update to 1.18.5 and add Brand to config, required for getting shared appliances

* update version to 0.18.6

* start fixing tests

* fix typo

* check for falsy values instead of explicit None

* move CONF_BRAND from global constants to whirlpool constants

* add test for no brand, fix __init__ import

* add brand to string.json

* add brand to re-auth

* add title/description, add brand info to description

* add reauth strings

* pass already initialized data dict

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* remove trailing comma

* Update strings again

* fix reauth tests to add brand

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-03-20 02:02:45 +01:00

35 lines
1.0 KiB
Python

"""Tests for the Whirlpool Sixth Sense integration."""
from homeassistant.components.whirlpool.const import CONF_BRAND, DOMAIN
from homeassistant.const import CONF_PASSWORD, CONF_REGION, CONF_USERNAME
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
async def init_integration(
hass: HomeAssistant, region: str = "EU", brand: str = "Whirlpool"
) -> MockConfigEntry:
"""Set up the Whirlpool integration in Home Assistant."""
entry = MockConfigEntry(
domain=DOMAIN,
data={
CONF_USERNAME: "nobody",
CONF_PASSWORD: "qwerty",
CONF_REGION: region,
CONF_BRAND: brand,
},
)
return await init_integration_with_entry(hass, entry)
async def init_integration_with_entry(
hass: HomeAssistant, entry: MockConfigEntry
) -> MockConfigEntry:
"""Set up the Whirlpool integration in Home Assistant."""
entry.add_to_hass(hass)
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
return entry