Skip to content

Commit

Permalink
add ping intervall as websocket parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Leggin committed Apr 5, 2024
1 parent 3e7ca5e commit 74d35a5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dirigera/hub/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def create_event_listener(
on_pong: Any = None,
on_data: Any = None,
on_cont_message: Any = None,
ping_intervall: int = 60,
) -> None:
wsapp = websocket.WebSocketApp(
self.websocket_base_url,
Expand All @@ -71,7 +72,9 @@ def create_event_listener(
on_cont_message=on_cont_message,
)

wsapp.run_forever(sslopt={"cert_reqs": ssl.CERT_NONE})
wsapp.run_forever(
sslopt={"cert_reqs": ssl.CERT_NONE}, ping_interval=ping_intervall
)

def patch(self, route: str, data: List[Dict[str, Any]]) -> Any:
response = requests.patch(
Expand Down

0 comments on commit 74d35a5

Please sign in to comment.