mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
parent
71e120ce97
commit
876b5fbe96
@ -38,9 +38,12 @@ class FlowHandler(config_entries.ConfigFlow):
|
||||
"""Create device."""
|
||||
from pydaikin.appliance import Appliance
|
||||
try:
|
||||
device = Appliance(
|
||||
host,
|
||||
self.hass.helpers.aiohttp_client.async_get_clientsession(),
|
||||
)
|
||||
with async_timeout.timeout(10):
|
||||
device = await self.hass.async_add_executor_job(
|
||||
Appliance, host)
|
||||
await device.init()
|
||||
except asyncio.TimeoutError:
|
||||
return self.async_abort(reason='device_timeout')
|
||||
except Exception: # pylint: disable=broad-except
|
||||
|
@ -24,9 +24,14 @@ def init_config_flow(hass):
|
||||
|
||||
@pytest.fixture
|
||||
def mock_daikin():
|
||||
"""Mock tellduslive."""
|
||||
"""Mock pydaikin."""
|
||||
async def mock_daikin_init():
|
||||
"""Mock the init function in pydaikin."""
|
||||
pass
|
||||
|
||||
with MockDependency('pydaikin.appliance') as mock_daikin_:
|
||||
mock_daikin_.Appliance().values.get.return_value = 'AABBCCDDEEFF'
|
||||
mock_daikin_.Appliance().init = mock_daikin_init
|
||||
yield mock_daikin_
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user