* Add Integration for Goal Zero Yeti Power Stations * Goal Zero Yeti integration with config flow * Remove unused entities * Remove entry from requirements_test_all * Pylint fix * Apply suggestions from code review Co-authored-by: Franck Nijhof <frenck@frenck.nl> * Add tests for goalzero integration * Fix UNIT_PERCENTAGE to PERCENTAGE * isort PERCENTAGE * Add tests * Add en translation * Fix tests * bump goalzero to 0.1.1 * fix await * bump goalzero to 0.1.2 * Update tests/components/goalzero/__init__.py Co-authored-by: J. Nick Koston <nick@koston.org> * apply recommended changes * isort * bump goalzero to 0.1.4 * apply recommended changes * apply recommended changes Co-authored-by: Franck Nijhof <frenck@frenck.nl> Co-authored-by: J. Nick Koston <nick@koston.org>
35 lines
741 B
Python
35 lines
741 B
Python
"""Tests for the Goal Zero Yeti integration."""
|
|
|
|
from homeassistant.const import CONF_HOST, CONF_NAME
|
|
|
|
from tests.async_mock import AsyncMock, patch
|
|
|
|
HOST = "1.2.3.4"
|
|
NAME = "Yeti"
|
|
|
|
CONF_DATA = {
|
|
CONF_HOST: HOST,
|
|
CONF_NAME: NAME,
|
|
}
|
|
|
|
CONF_CONFIG_FLOW = {
|
|
CONF_HOST: HOST,
|
|
CONF_NAME: NAME,
|
|
}
|
|
|
|
|
|
async def _create_mocked_yeti(raise_exception=False):
|
|
mocked_yeti = AsyncMock()
|
|
mocked_yeti.get_state = AsyncMock()
|
|
return mocked_yeti
|
|
|
|
|
|
def _patch_init_yeti(mocked_yeti):
|
|
return patch("homeassistant.components.goalzero.Yeti", return_value=mocked_yeti)
|
|
|
|
|
|
def _patch_config_flow_yeti(mocked_yeti):
|
|
return patch(
|
|
"homeassistant.components.goalzero.config_flow.Yeti",
|
|
return_value=mocked_yeti,
|
|
)
|