Fix various Daikin issues (#34249)
* various Daikin fixes * make timeout a constant
This commit is contained in:
1 parent
d842dacfd6
commit
337cc6e79f
7 files changed
+11
-8
No files matched your search
@@ -17,6 +17,7 @@ from homeassistant.helpers.typing import HomeAssistantType
|
||||
from homeassistant.util import Throttle
|
||||
|
||||
from . import config_flow # noqa: F401
|
||||
from .const import TIMEOUT
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -91,7 +92,7 @@ async def daikin_api_setup(hass, host):
|
||||
|
||||
session = hass.helpers.aiohttp_client.async_get_clientsession()
|
||||
try:
|
||||
with timeout(10):
|
||||
with timeout(TIMEOUT):
|
||||
device = Appliance(host, session)
|
||||
await device.init()
|
||||
except asyncio.TimeoutError:
|
||||
|
||||
@@ -10,7 +10,7 @@ import voluptuous as vol
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.const import CONF_HOST
|
||||
|
||||
from .const import KEY_IP, KEY_MAC
|
||||
from .const import KEY_IP, KEY_MAC, TIMEOUT
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -38,7 +38,7 @@ class FlowHandler(config_entries.ConfigFlow):
|
||||
device = Appliance(
|
||||
host, self.hass.helpers.aiohttp_client.async_get_clientsession()
|
||||
)
|
||||
with timeout(10):
|
||||
with timeout(TIMEOUT):
|
||||
await device.init()
|
||||
except asyncio.TimeoutError:
|
||||
return self.async_abort(reason="device_timeout")
|
||||
|
||||
@@ -25,3 +25,5 @@ SENSOR_TYPES = {
|
||||
|
||||
KEY_MAC = "mac"
|
||||
KEY_IP = "ip"
|
||||
|
||||
TIMEOUT = 60
|
||||
@@ -3,7 +3,7 @@
|
||||
"name": "Daikin AC",
|
||||
"config_flow": true,
|
||||
"documentation": "https://www.home-assistant.io/integrations/daikin",
|
||||
"requirements": ["pydaikin==1.6.2"],
|
||||
"codeowners": ["@fredrike", "@rofrantz"],
|
||||
"requirements": ["pydaikin==1.6.3"],
|
||||
"codeowners": ["@fredrike"],
|
||||
"quality_scale": "platinum"
|
||||
}
|
||||
Reference in new issue
Block a user