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 a96e332d63 - Show all commits

View File

@@ -51,14 +51,14 @@ 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_SINGLE, RIEndpoint.GESTURE_TAG
] ]
data: str data: str
is_priority: bool = False is_priority: bool = False
@model_validator(mode="after") @model_validator(mode="after")
def check_endpoint(self): def check_endpoint(self):
allowed = {RIEndpoint.GESTURE_SINGLE, RIEndpoint.GESTURE_TAG, RIEndpoint.GESTURE_SINGLE} allowed = {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, GESTURE_TAG or GESTURE_BASIC") raise ValueError("endpoint must be GESTURE_SINGLE, GESTURE_TAG or GESTURE_BASIC")
return self return self