chore: adjust message/command structure and write unit tests

ref: N25B-205
This commit is contained in:
Björn Otgaar
2025-10-23 12:54:53 +02:00
parent 530fc42c50
commit 1f8d769762
7 changed files with 90 additions and 12 deletions

View File

@@ -0,0 +1,20 @@
from enum import Enum
from typing import Any, Literal
from pydantic import BaseModel, Field, ValidationError
class RIEndpoint(str, Enum):
SPEECH = "actuate/speech"
PING = "ping"
NEGOTIATE_PORTS = "negotiate/ports"
class RIMessage(BaseModel):
endpoint: RIEndpoint
data: Any
class SpeechCommand(RIMessage):
endpoint: RIEndpoint = RIEndpoint(RIEndpoint.SPEECH)
data: str