mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
26 lines
718 B
Python
26 lines
718 B
Python
from queues import DATA_QUEUE_TRANSMIT
|
|
import structlog
|
|
log = structlog.get_logger("COMMANDS")
|
|
|
|
def cqcqcq():
|
|
DATA_QUEUE_TRANSMIT.put(["CQ"])
|
|
|
|
def ping_ping(data):
|
|
try:
|
|
dxcallsign = data["dxcallsign"]
|
|
if not str(dxcallsign).strip():
|
|
return
|
|
DATA_QUEUE_TRANSMIT.put(["PING", None, dxcallsign])
|
|
|
|
except Exception as err:
|
|
log.warning(
|
|
"[CMD] PING command execution error", e=err, command=data
|
|
)
|
|
|
|
def beacon(data):
|
|
beacon_state = data['enabled'] in ['True']
|
|
#Beacon.beacon_state = beacon_state
|
|
log.info(
|
|
"[CMD] Changing beacon state", state=beacon_state
|
|
)
|
|
DATA_QUEUE_TRANSMIT.put(["BEACON", 300, beacon_state])
|