Skip to content

Commit d7669b4

Browse files
committed
fix: allow adjusting timeout (#86)
* fix: add missing ability to adjust timeout for OmniLogicAPI * fix: use DEFAULT_RESPONSE_TIMEOUT const
1 parent 4090a9e commit d7669b4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pyomnilogic_local/omnilogic.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from typing import TYPE_CHECKING, Any
77

88
from pyomnilogic_local.api import OmniLogicAPI
9+
from pyomnilogic_local.api.constants import DEFAULT_RESPONSE_TIMEOUT
910
from pyomnilogic_local.backyard import Backyard
1011
from pyomnilogic_local.collections import EquipmentDict
1112
from pyomnilogic_local.groups import Group
@@ -50,11 +51,11 @@ class OmniLogic:
5051
_min_mspversion: str = "R05"
5152
_warned_mspversion: bool = False
5253

53-
def __init__(self, host: str, port: int = 10444) -> None:
54+
def __init__(self, host: str, port: int = 10444, timeout: float = DEFAULT_RESPONSE_TIMEOUT) -> None:
5455
self.host = host
5556
self.port = port
5657

57-
self._api = OmniLogicAPI(host, port)
58+
self._api = OmniLogicAPI(host, port, timeout)
5859
self._refresh_lock = asyncio.Lock()
5960

6061
def __repr__(self) -> str:

0 commit comments

Comments
 (0)