Updated MQTT message states.

This commit is contained in:
Marat Fayzullin 2024-08-03 12:55:11 -04:00
parent 75927656be
commit 507f43df16
2 changed files with 7 additions and 7 deletions

View File

@ -146,12 +146,12 @@ Support and info: https://groups.io/g/openwebrx
# Instantiate and refresh marker database
Markers.start()
# Report receiver started
# Report server started
ReportingEngine.getSharedInstance().spot({
"mode" : "RX",
"timestamp" : round(datetime.now().timestamp() * 1000),
"version" : openwebrx_version,
"state" : "ReceiverStarted"
"state" : "ServerStarted"
})
try:
@ -183,12 +183,12 @@ Support and info: https://groups.io/g/openwebrx
SdrService.stopAllSources()
DecoderQueue.stopAll()
# Report receiver stopped
# Report server stopped
ReportingEngine.getSharedInstance().spot({
"mode" : "RX",
"timestamp" : round(datetime.now().timestamp() * 1000),
"version" : openwebrx_version,
"state" : "ReceiverStopped"
"state" : "ServerStopped"
})
# Done with reporting now

View File

@ -52,13 +52,13 @@ class ClientRegistry(object):
raise TooManyClientsException()
self.clients.append(client)
self.broadcast()
self.reportClient(client, { "state":"CONNECTED" })
self.reportClient(client, { "state":"Connected" })
def clientCount(self):
return len(self.clients)
def removeClient(self, client):
self.reportClient(client, { "state":"DISCONNECTED" })
self.reportClient(client, { "state":"Disconnected" })
try:
if client in self.chat:
del self.chat[client]
@ -88,7 +88,7 @@ class ClientRegistry(object):
def reportChatMessage(self, client, text: str):
name = self.chat[client]["name"] if client in self.chat else "???"
self.reportClient(client, {
"state" : "CHAT",
"state" : "ChatMessage",
"name" : name,
"message" : text
})