fluidd-core / fluidd

Fluidd, the klipper UI.
https://docs.fluidd.xyz
GNU General Public License v3.0
1.35k stars 410 forks source link

feat(spoolman): live update support #1301

Closed matmen closed 7 months ago

matmen commented 7 months ago

Adds a WebSocket connection to listen for Spoolman state changes

matmen commented 7 months ago

@Donkie While implementing this, I've noticed there's no spool updates being fired when the spools filament object is updated. Do you think it makes sense to fire update events cascadingly so a single WS connection suffices or does it make more sense to subscribe to the root endpoint and handle the state updates in the frontend (i.e. finding all spools with the associated filament ID and overwriting the vendor)?

Donkie commented 7 months ago

Hmm, that's not something I've thought of. I feel like it would fire a lot of events unnecessarily if I changed the backend to cascadely send events to all spools if a filament changes. If it's easy for you I think it'd be better if you also subscribe to the filament of the spool if you're interested in changes in it.