mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Set connection and command timeout in VLC Telnet (#126401)
use 1s lower than scan interval
This commit is contained in:
parent
505fb3738f
commit
9bfc2eaeb9
@ -5,6 +5,9 @@ from dataclasses import dataclass
|
|||||||
from aiovlc.client import Client
|
from aiovlc.client import Client
|
||||||
from aiovlc.exceptions import AuthError, ConnectError
|
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.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, Platform
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, Platform
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
@ -33,7 +36,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: VlcConfigEntry) -> bool:
|
|||||||
port = config[CONF_PORT]
|
port = config[CONF_PORT]
|
||||||
password = config[CONF_PASSWORD]
|
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
|
available = True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user