Fix User Profile and Repeater Links
This commit is contained in:
parent
7f08a655d8
commit
2fbd529c93
1 changed files with 5 additions and 5 deletions
10
main.py
10
main.py
|
|
@ -95,7 +95,7 @@ for master in bm_clustermasters_json:
|
||||||
|
|
||||||
# SocketIO setup for the MQTT socket handling
|
# SocketIO setup for the MQTT socket handling
|
||||||
sio = socketio.Client(reconnection=True, reconnection_attempts=0, reconnection_delay=5, reconnection_delay_max=60)
|
sio = socketio.Client(reconnection=True, reconnection_attempts=0, reconnection_delay=5, reconnection_delay_max=60)
|
||||||
|
|
||||||
@sio.event
|
@sio.event
|
||||||
def connect():
|
def connect():
|
||||||
print('connected to server')
|
print('connected to server')
|
||||||
|
|
@ -103,11 +103,11 @@ def connect():
|
||||||
# otherwise the server keeps the connection open but sends no data.
|
# otherwise the server keeps the connection open but sends no data.
|
||||||
sio.emit("join", "everything")
|
sio.emit("join", "everything")
|
||||||
print('subscribed to LastHeard stream (join/everything)')
|
print('subscribed to LastHeard stream (join/everything)')
|
||||||
|
|
||||||
@sio.event
|
@sio.event
|
||||||
def disconnect():
|
def disconnect():
|
||||||
print('disconnected from server, reconnecting...')
|
print('disconnected from server, reconnecting...')
|
||||||
|
|
||||||
@sio.on("mqtt")
|
@sio.on("mqtt")
|
||||||
def on_mqtt(data):
|
def on_mqtt(data):
|
||||||
epoch_time = int(time.time())
|
epoch_time = int(time.time())
|
||||||
|
|
@ -120,7 +120,7 @@ def on_mqtt(data):
|
||||||
max_old_time = epoch_time - 20
|
max_old_time = epoch_time - 20
|
||||||
|
|
||||||
# Build the message that will be sent to Telegram
|
# Build the message that will be sent to Telegram
|
||||||
telegram_message = "Callsign: <b><a href='https://brandmeister.network/index.php?page=profile&call=" +jsondata["SourceCall"] + "'>" + jsondata["SourceCall"] + "</a></b> ID: <b>" + str(jsondata["SourceID"]) + " </b> \nName: " +jsondata["SourceName"] + " \nTalkeralias: <b>" + jsondata["TalkerAlias"] + "</b> \n-----------------------------------\nAccess via: <b>" + jsondata["LinkName"] + " </b>\nVia repeater: <b><a href='https://brandmeister.network/?page=device&id=" + str(jsondata["ContextID"]) + "'>" + jsondata["LinkCall"] + "</a></b>\nSlot: " + str(jsondata["Slot"]) + " TG: " + str(jsondata["DestinationID"]) + "\nMaster: " + str(jsondata["Master"]) + "\nRSSI: <b>" + str(jsondata["RSSI"]) + " dBm</b> BER: <b>" + str(round(jsondata["BER"],2)) + "%</b>"
|
telegram_message = "Callsign: <b><a href='https://brandmeister.network/#/profile/" +jsondata["SourceCall"] + "'>" + jsondata["SourceCall"] + "</a></b> ID: <b>" + str(jsondata["SourceID"]) + " </b> \nName: " +jsondata["SourceName"] + " \nTalkeralias: <b>" + jsondata["TalkerAlias"] + "</b> \n-----------------------------------\nAccess via: <b>" + jsondata["LinkName"] + " </b>\nVia repeater: <b><a href='https://brandmeister.network/#/device/" + str(jsondata["ContextID"]) + "'>" + jsondata["LinkCall"] + "</a></b>\nSlot: " + str(jsondata["Slot"]) + " TG: " + str(jsondata["DestinationID"]) + "\nMaster: " + str(jsondata["Master"]) + "\nRSSI: <b>" + str(jsondata["RSSI"]) + " dBm</b> BER: <b>" + str(round(jsondata["BER"],2)) + "%</b>"
|
||||||
context_id = _as_int(jsondata["ContextID"])
|
context_id = _as_int(jsondata["ContextID"])
|
||||||
event_slot = _as_int(jsondata["Slot"])
|
event_slot = _as_int(jsondata["Slot"])
|
||||||
|
|
||||||
|
|
@ -159,7 +159,7 @@ def on_mqtt(data):
|
||||||
print ("matched via Mirror-TG")
|
print ("matched via Mirror-TG")
|
||||||
send_telegram_message(telegram_message)
|
send_telegram_message(telegram_message)
|
||||||
return
|
return
|
||||||
|
|
||||||
bm_url = 'https://api.brandmeister.network'
|
bm_url = 'https://api.brandmeister.network'
|
||||||
bm_path = "/lh/socket.io"
|
bm_path = "/lh/socket.io"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue