Skip to content
This repository has been archived by the owner on Aug 24, 2024. It is now read-only.

Commit

Permalink
add timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveicedgreentea committed Jan 20, 2023
1 parent d4077ee commit 48ca082
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions custom_components/jvc_projectors/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import voluptuous as vol

from homeassistant.components.remote import PLATFORM_SCHEMA, RemoteEntity
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_TIMEOUT
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_TIMEOUT, CONF_SCAN_INTERVAL
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv, entity_platform
from homeassistant.helpers.entity_platform import AddEntitiesCallback
Expand All @@ -24,7 +24,8 @@
vol.Required(CONF_NAME): cv.string,
vol.Required(CONF_HOST): cv.string,
vol.Optional(CONF_PASSWORD): cv.string,
vol.Optional(CONF_TIMEOUT): cv.string,
vol.Required(CONF_SCAN_INTERVAL): cv.time_period,
vol.Optional(CONF_TIMEOUT): cv.positive_int,
}
)

Expand All @@ -43,7 +44,7 @@ def setup_platform(
host=host,
password=password,
logger=_LOGGER,
connect_timeout=config.get(CONF_TIMEOUT),
connect_timeout=int(config.get(CONF_TIMEOUT, 3)),
)
# create a long lived connection
jvc_client.open_connection()
Expand Down

0 comments on commit 48ca082

Please sign in to comment.