modify led_cmd

This commit is contained in:
2025-10-27 15:31:17 +08:00
parent 0543b73ef4
commit a4d2e14f02

View File

@@ -352,13 +352,13 @@ def build_ui(node: CtrlGuiNode) -> None:
# LED control
with ui.column():
with ui.row():
color_input = ui.select(['red', 'green', 'blue', 'cyan', 'yellow', 'purple', 'white'], value='red').style('width: 100px')
color_input = ui.select(['red', 'green', 'blue', 'cyan', 'yellow', 'purple', 'white', 'off'], value='red').style('width: 100px')
def led_control_() -> None:
try:
# TODO check input data
text = f"data: {{{color_input.value}, 10}}"
text = f"{color_input.value}, 10"
node.publish_info(text)
ui.notify(f'Sent: {text}')
except Exception as e: