Closed dersimn closed 10 months ago
First of all, thanks for your contribution. But can you please explain your proposed change with a bit more details please. Why is it necessary to set this clients v2 url parameter? And also please explain what might be other potential use cases for this urlParams parameter? And why would one set or not set this clients v2 Parameter and not simply send it always in newer versions of node-unifi?
tbh, I don't know if there are other options than this client=v2.
If you use the web inspector on the latest UniFi Console, it's one of the options parameters that the official WebUI uses (in my case it is: wss://192.168.2.113:8443/wss/s/default/events?clients=v2&critical_notifications=true
).
If you specify this parameter you'll receive this client:sync
events every few seconds, if you leave the option away the WebSocket is rather silent. I'd like to receive these messages as some kind of heartbeat signal that a client is still online. (If you listen to the disconnect events that shouldn't be necessary, but in my experience these UniFi Events are never 100% reliable.)
Allow to supply urlParams for WebSocket connection, one use-case is to enable
client:sync
messages that will update the listener in regular intervals about the current state of a clientExample output: