Make timeout adjustable (#494)

This commit is contained in:
J. Nick Koston
2023-10-07 08:58:00 -10:00
committed by GitHub
parent 20b3f7a771
commit 0ec0826cc7
10 changed files with 39 additions and 17 deletions

View File

@@ -195,6 +195,7 @@ class SmartDevice:
*,
port: Optional[int] = None,
credentials: Optional[Credentials] = None,
timeout: Optional[int] = None,
) -> None:
"""Create a new SmartDevice instance.
@@ -203,7 +204,7 @@ class SmartDevice:
self.host = host
self.port = port
self.protocol = TPLinkSmartHomeProtocol(host, port=port)
self.protocol = TPLinkSmartHomeProtocol(host, port=port, timeout=timeout)
self.credentials = credentials
_LOGGER.debug("Initializing %s of type %s", self.host, type(self))
self._device_type = DeviceType.Unknown