mirror of
https://github.com/EvolutionAPI/evolution-client-python.git
synced 2025-07-13 07:04:49 -06:00

- Implement WebSocketConfig and WebSocketInfo models for event configuration - Add create_websocket() method in the client for simplified creation of WebSocket handlers - Expand WebSocket service with set_websocket() and find_websocket() methods - Update README with detailed documentation on WebSocket configuration and usage - Add new event handlers in the test example (on_qrcode, on_connection)
20 lines
469 B
Python
20 lines
469 B
Python
from typing import List, Optional
|
|
from dataclasses import dataclass
|
|
|
|
@dataclass
|
|
class WebSocketConfig:
|
|
enabled: bool
|
|
events: List[str]
|
|
|
|
def __init__(self, enabled: bool, events: List[str]):
|
|
self.enabled = enabled
|
|
self.events = events
|
|
|
|
@dataclass
|
|
class WebSocketInfo:
|
|
enabled: bool
|
|
events: List[str]
|
|
|
|
def __init__(self, **kwargs):
|
|
self.enabled = kwargs.get('enabled', False)
|
|
self.events = kwargs.get('events', []) |