No, it's not the case. Only location data and events are pushed via WebSocket.
Looking at traccar/api/AsyncSocket.java, devices' data is sent via WebSocket (to initialize the Devices store in the web application),
so updating a device should not be difficult ? Or is it ?
If one changes eg. the name of the device, or the category via the API, one expects to have those modifications reflected on the web-side (especially since it's WebSocket, there should be no need to reload the application). Or is there a reason for keeping devices out of sync ?
Is this feature planned in the future ?
Any pointers to the relevant parts of the code would be appreciated
Thanks,
It's definitely possible. Not sure how much effort it is. I don't recall many requests for this feature, so there is no plan to implement it at this point.
Ok, say I want for example to update the device name and marker depending on the category, to give a try.
What are the files or functions that would need changes (so I can start at good places) ?
Code is not that documented..
+1
Please send new devices on the websocket
@Anton can you pretty please give us some hints about where to look ?
Everyone is wondering why any change done via the API is not pushed to the clients (Web interface in this case)
https://en.m.wikipedia.org/wiki/Principle_of_least_astonishment
If one does a change through the API, THEN it MUST be propagated everywhere, or there is no point
Or rename this as a write-only API ?
That's a considerable lose in interest for this great product for many people
Just look at how device status updates are implemented and do the same for other models.
At least one filename would be a good start ?
Thanks
https://www.openhub.net/p/traccar/factoids#FactoidCommentsLow
File name for what? There are many classes involved. You can start with Device model class and see where and how it's used. It should lead you to the right places.
OK
Hi @Armstrong and @maww3ll, 6 years later I need the same thing :)
If I open 2 web clients, when I change the name or the category of a device, it's not updated on the second web client.
Did you find a way and could you explain it to me ?
Thank you :)
Hello,
Title says it all:
Aren't updates supposed to go through the websocket ? I thought it'd be the case, seems it's not ?