Now reporting chat messages via MQTT.
This commit is contained in:
parent
aa0e7513ab
commit
2bdcdc034d
|
|
@ -1,5 +1,6 @@
|
|||
from owrx.config import Config
|
||||
from owrx.color import ColorCache
|
||||
from owrx.reporting import ReportingEngine
|
||||
from datetime import datetime, timedelta
|
||||
from ipaddress import ip_address
|
||||
import threading
|
||||
|
|
@ -104,6 +105,14 @@ class ClientRegistry(object):
|
|||
self.chat[client] = { "name": name, "color": color }
|
||||
self.chatCount = self.chatCount + 1
|
||||
|
||||
# Report message
|
||||
ReportingEngine.getSharedInstance().spot({
|
||||
"mode" : "CHAT",
|
||||
"timestamp" : round(datetime.now().timestamp() * 1000),
|
||||
"name" : name,
|
||||
"message" : text
|
||||
})
|
||||
|
||||
# Broadcast message to all clients
|
||||
for c in self.clients:
|
||||
c.write_chat_message(name, text, color)
|
||||
|
|
|
|||
Loading…
Reference in New Issue