Set connection and command timeout in VLC Telnet (#126401)
use 1s lower than scan interval
This commit is contained in:
parent
505fb3738f
commit
9bfc2eaeb9
1 changed files with 9 additions and 1 deletions
|
@ -5,6 +5,9 @@ from dataclasses import dataclass
|
|||
from aiovlc.client import Client
|
||||
from aiovlc.exceptions import AuthError, ConnectError
|
||||
|
||||
from homeassistant.components.media_player import (
|
||||
SCAN_INTERVAL as MEDIAPLAYER_SCAN_INTERVAL,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
@ -33,7 +36,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: VlcConfigEntry) -> bool:
|
|||
port = config[CONF_PORT]
|
||||
password = config[CONF_PASSWORD]
|
||||
|
||||
vlc = Client(password=password, host=host, port=port)
|
||||
vlc = Client(
|
||||
password=password,
|
||||
host=host,
|
||||
port=port,
|
||||
timeout=int(MEDIAPLAYER_SCAN_INTERVAL.total_seconds() - 1),
|
||||
)
|
||||
|
||||
available = True
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue