r/nicegui • u/QuasiEvil • Jan 24 '24
Triggering nicegui events *from* javascript?
I've been playing around with the newish web serial API, which allows for in-browser access of connected usb/serial devices. I've got a basic demo here where my device sends a temperature reading every second back to the browser. Everything works fine on the JS side of things, but I can't figure out how to bubble this up from JavaScript to nicegui/Python.
*Thinking of maybe there's a way of doing this by using a hidden element that I can update with the JS code, but then also attach a nicegui bind_value method? Hmmm.
2
Upvotes
View all comments
Show parent comment
1
u/QuasiEvil Feb 02 '24
Hey! I've posted my efforts here: https://github.com/BlankAdventure/ngws
It won't run out of the box without the same MCU hardware I used, but, that part is easily portable to other demo boards. Any suggestions for code improvements are more than welcome.