feat: added way to communicate 10 basic gestures #41

Closed
2584433 wants to merge 6 commits from feat/10-basic-gestures into dev
Showing only changes of commit 8cfd59c14b - Show all commits

View File

@@ -12,6 +12,7 @@ class RIEndpoint(str, Enum):
SPEECH = "actuate/speech" SPEECH = "actuate/speech"
GESTURE_SINGLE = "actuate/gesture/single" GESTURE_SINGLE = "actuate/gesture/single"
GESTURE_TAG = "actuate/gesture/tag" GESTURE_TAG = "actuate/gesture/tag"
GESTURE_BASIC = "actuate/gesture/single"
PING = "ping" PING = "ping"
NEGOTIATE_PORTS = "negotiate/ports" NEGOTIATE_PORTS = "negotiate/ports"
@@ -49,16 +50,13 @@ class GestureCommand(RIMessage):
""" """
endpoint: Literal[ # pyright: ignore[reportIncompatibleVariableOverride] - We validate this stricter rule ourselves endpoint: Literal[ # pyright: ignore[reportIncompatibleVariableOverride] - We validate this stricter rule ourselves
RIEndpoint.GESTURE_SINGLE, RIEndpoint.GESTURE_TAG RIEndpoint.GESTURE_SINGLE, RIEndpoint.GESTURE_TAG, RIEndpoint.GESTURE_SINGLE
] ]
data: str data: str
@model_validator(mode="after") @model_validator(mode="after")
def check_endpoint(self): def check_endpoint(self):
allowed = { allowed = {RIEndpoint.GESTURE_SINGLE, RIEndpoint.GESTURE_TAG, RIEndpoint.GESTURE_SINGLE}
RIEndpoint.GESTURE_SINGLE,
RIEndpoint.GESTURE_TAG,
}
if self.endpoint not in allowed: if self.endpoint not in allowed:
raise ValueError("endpoint must be GESTURE_SINGLE or GESTURE_TAG") raise ValueError("endpoint must be GESTURE_SINGLE, GESTURE_TAG or GESTURE_BASIC")
return self return self