kopia lustrzana https://github.com/mate-dev/meshtastic-matrix-relay
support custom channel
rodzic
0500e37fa8
commit
957a4e3b76
|
@ -39,6 +39,7 @@ matrix:
|
|||
meshtastic:
|
||||
host: "meshtastic.local"
|
||||
broadcast_enabled: false
|
||||
channel: 0
|
||||
|
||||
logging:
|
||||
level: "debug"
|
||||
|
|
10
main.py
10
main.py
|
@ -157,13 +157,19 @@ async def on_room_message(room: MatrixRoom, event: RoomMessageText) -> None:
|
|||
logger.debug(
|
||||
f"Sending radio message from {event.sender} to {target_node} ..."
|
||||
)
|
||||
meshtastic_interface.sendText(text, destinationId=target_node)
|
||||
meshtastic_interface.sendText(
|
||||
text=text,
|
||||
channelIndex=relay_config["meshtastic"]["channel"],
|
||||
destinationId=target_node,
|
||||
)
|
||||
logger.info(f"Sent radio message from {event.sender} to {target_node}")
|
||||
elif relay_config["meshtastic"]["broadcast_enabled"]:
|
||||
logger.debug(
|
||||
f"Sending radio message from {event.sender} to radio broadcast ..."
|
||||
)
|
||||
meshtastic_interface.sendText(text)
|
||||
meshtastic_interface.sendText(
|
||||
text=text, channelIndex=relay_config["meshtastic"]["channel"]
|
||||
)
|
||||
logger.info(f"Sent radio message from {event.sender} to radio broadcast")
|
||||
elif not relay_config["meshtastic"]["broadcast_enabled"]:
|
||||
logger.debug(
|
||||
|
|
|
@ -7,6 +7,7 @@ matrix:
|
|||
meshtastic:
|
||||
host: "meshtastic.local"
|
||||
broadcast_enabled: false
|
||||
channel: 0
|
||||
|
||||
logging:
|
||||
level: "debug"
|
||||
|
|
Ładowanie…
Reference in New Issue