Migrate MCP and utilities to CircuitPython, including color GIF and volume fixes
This commit is contained in:
@@ -474,6 +474,28 @@ class MCPServer:
|
||||
"name": "get_stream_stats",
|
||||
"description": "Get real-time device-side performance and frame-rate statistics for the TCP/UDP video stream.",
|
||||
"inputSchema": {"type": "object", "properties": {}}
|
||||
},
|
||||
{
|
||||
"name": "set_backlight",
|
||||
"description": "Adjust the brightness of the LCD backlight.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"brightness": {"type": "integer", "minimum": 0, "maximum": 100, "description": "Backlight brightness percentage (0-100)"}
|
||||
},
|
||||
"required": ["brightness"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "set_screen_power",
|
||||
"description": "Turn the screen/display on or off.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"power": {"type": "boolean", "description": "True to turn display ON, False to turn display OFF"}
|
||||
},
|
||||
"required": ["power"]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -526,6 +548,22 @@ class MCPServer:
|
||||
self.display.show()
|
||||
return "Screen cleared."
|
||||
|
||||
elif name == "set_backlight":
|
||||
brightness = int(args.get("brightness", 100))
|
||||
if hasattr(self.display, "set_brightness"):
|
||||
self.display.set_brightness(brightness)
|
||||
return f"Backlight brightness set to {brightness}%."
|
||||
else:
|
||||
return "Backlight brightness control not supported on this display."
|
||||
|
||||
elif name == "set_screen_power":
|
||||
power = bool(args.get("power", True))
|
||||
if hasattr(self.display, "set_power"):
|
||||
self.display.set_power(power)
|
||||
status = "ON" if power else "OFF"
|
||||
return f"Screen power set to {status}."
|
||||
else:
|
||||
return "Screen power control not supported on this display."
|
||||
elif name == "draw_text":
|
||||
self.override_active = True
|
||||
text = str(args.get("text", ""))
|
||||
|
||||
Reference in New Issue
Block a user