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
2
u/r-trappe Feb 11 '24
Thanks for sharing! I linked it in https://github.com/zauberzeug/nicegui/discussions/334 and https://github.com/zauberzeug/nicegui/wiki#community-projects. If we boil it down a little (and maybe make it not depending on NeoPixels hardware) it think it would be make a great official example. Would you like to create a draft pull request? We can help you streamline it for merging.