Add MQTT publish request and response models, and implement publish route

- Introduced MQTTPublishRequest and MQTTPublishResponse models for handling MQTT message publishing.
- Implemented a new POST route for publishing MQTT messages, including error handling and logging.
- Enhanced the StandaloneAutoRecorder with improved logging during manual recording start.
- Updated the frontend to include an MQTT Debug Panel for better monitoring and debugging capabilities.
This commit is contained in:
salirezav
2025-12-01 13:07:36 -05:00
parent 5070d9b2ca
commit 73849b40a8
11 changed files with 950 additions and 19 deletions

View File

@@ -334,3 +334,21 @@ class SuccessResponse(BaseModel):
message: str
data: Optional[Dict[str, Any]] = None
timestamp: str = Field(default_factory=lambda: datetime.now().isoformat())
class MQTTPublishRequest(BaseModel):
"""MQTT publish request model"""
topic: str = Field(..., description="MQTT topic to publish to")
payload: str = Field(..., description="Message payload")
qos: int = Field(default=0, ge=0, le=2, description="Quality of Service level (0-2)")
retain: bool = Field(default=False, description="Whether to retain the message")
class MQTTPublishResponse(BaseModel):
"""MQTT publish response model"""
success: bool
message: str
topic: str
payload: str