mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 19:09:32 +00:00
* Added smarla integration * Apply suggested changes * Bump pysmarlaapi version and reevaluate quality scale * Focus on switch platform * Bump pysmarlaapi version * Change default name of device * Code refactoring * Removed obsolete reload function * Code refactoring and clean up * Bump pysmarlaapi version * Refactoring and changed access token format * Fix tests for smarla config_flow * Update quality_scale * Major rework of tests and refactoring * Bump pysmarlaapi version * Use object equality operator when applicable * Refactoring * Patch both connection objects * Refactor tests * Fix leaking tests * Implemented full test coverage * Bump pysmarlaapi version * Fix tests * Improve tests --------- Co-authored-by: Joostlek <joostlek@outlook.com>
23 lines
714 B
Python
23 lines
714 B
Python
"""Tests for the Smarla integration."""
|
|
|
|
from typing import Any
|
|
from unittest.mock import AsyncMock
|
|
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from tests.common import MockConfigEntry
|
|
|
|
|
|
async def setup_integration(hass: HomeAssistant, config_entry: MockConfigEntry) -> bool:
|
|
"""Set up the component."""
|
|
config_entry.add_to_hass(hass)
|
|
if success := await hass.config_entries.async_setup(config_entry.entry_id):
|
|
await hass.async_block_till_done()
|
|
return success
|
|
|
|
|
|
async def update_property_listeners(mock: AsyncMock, value: Any = None) -> None:
|
|
"""Update the property listeners for the mock object."""
|
|
for call in mock.add_listener.call_args_list:
|
|
await call[0][0](value)
|