* Added govee_local_api * Code cleanup * Fix discovery * Add missing supported device * Fix autodiscovery * Add missing quality scale in manifest.json * QA * QA: Moved coordinator creation to __init__.py * QA * Fix typo and update test * QA * Removed unecessary code * Fix typo * Fix typo * QA, typing and strings * Removed unsed logger in __init__.py * QA, using ColorMode for lights capabilities * Bump govee_local_api to 1.4.0 Moved capabilities to library. * Update requirements * Update library to 1.4.1 with unsupported dvice warning * Fix tests after library update * QA * Add test for retry config * Update integration name and domain * Update homeassistant/components/govee_light_local/light.py --------- Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
37 lines
1.1 KiB
Python
37 lines
1.1 KiB
Python
"""Tests configuration for Govee Local API."""
|
|
from collections.abc import Generator
|
|
from unittest.mock import AsyncMock, patch
|
|
|
|
from govee_local_api import GoveeLightCapability
|
|
import pytest
|
|
|
|
from homeassistant.components.govee_light_local.coordinator import GoveeController
|
|
|
|
|
|
@pytest.fixture(name="mock_govee_api")
|
|
def fixture_mock_govee_api():
|
|
"""Set up Govee Local API fixture."""
|
|
mock_api = AsyncMock(spec=GoveeController)
|
|
mock_api.start = AsyncMock()
|
|
mock_api.turn_on_off = AsyncMock()
|
|
mock_api.set_brightness = AsyncMock()
|
|
mock_api.set_color = AsyncMock()
|
|
mock_api._async_update_data = AsyncMock()
|
|
return mock_api
|
|
|
|
|
|
@pytest.fixture(name="mock_setup_entry")
|
|
def fixture_mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
|
"""Override async_setup_entry."""
|
|
with patch(
|
|
"homeassistant.components.govee_light_local.async_setup_entry",
|
|
return_value=True,
|
|
) as mock_setup_entry:
|
|
yield mock_setup_entry
|
|
|
|
|
|
DEFAULT_CAPABILITEIS: set[GoveeLightCapability] = {
|
|
GoveeLightCapability.COLOR_RGB,
|
|
GoveeLightCapability.COLOR_KELVIN_TEMPERATURE,
|
|
GoveeLightCapability.BRIGHTNESS,
|
|
}
|