kopia lustrzana https://github.com/projecthorus/radiosonde_auto_rx
Merge pull request #599 from trgosk/upstream-testing-pr
Custom nearby landing email subjectpull/642/head
commit
c44382379a
|
|
@ -861,6 +861,7 @@ def main():
|
|||
mail_from=config["email_from"],
|
||||
mail_to=config["email_to"],
|
||||
mail_subject=config["email_subject"],
|
||||
mail_nearby_landing_subject=config["email_nearby_landing_subject"],
|
||||
station_position=(
|
||||
config["station_lat"],
|
||||
config["station_lon"],
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ def read_auto_rx_config(filename, no_sdr_test=False):
|
|||
"email_from": "sonde@localhost",
|
||||
"email_to": None,
|
||||
"email_subject": "<type> Sonde launch detected on <freq>: <id>",
|
||||
"email_nearby_landing_subject": "Nearby Radiosonde Landing Detected - <id>",
|
||||
# SDR Settings
|
||||
"sdr_type": "RTLSDR",
|
||||
"sdr_hostname": "localhost",
|
||||
|
|
@ -658,6 +659,16 @@ def read_auto_rx_config(filename, no_sdr_test=False):
|
|||
)
|
||||
auto_rx_config["experimental_decoders"]["MK2LMS"] = False
|
||||
|
||||
try:
|
||||
auto_rx_config["email_nearby_landing_subject"] = config.get(
|
||||
"email", "nearby_landing_subject"
|
||||
)
|
||||
except:
|
||||
logging.warning(
|
||||
"Config - Did not find email_nearby_landing_subject setting, using default"
|
||||
)
|
||||
auto_rx_config["email_nearby_landing_subject"] = "Nearby Radiosonde Landing Detected - <id>"
|
||||
|
||||
|
||||
# As of auto_rx version 1.5.10, we are limiting APRS output to only radiosondy.info,
|
||||
# and only on the non-forwarding port.
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ class EmailNotification(object):
|
|||
mail_from=None,
|
||||
mail_to=None,
|
||||
mail_subject=None,
|
||||
mail_nearby_landing_subject=None,
|
||||
station_position=None,
|
||||
launch_notifications=True,
|
||||
landing_notifications=True,
|
||||
|
|
@ -62,6 +63,7 @@ class EmailNotification(object):
|
|||
self.mail_from = mail_from
|
||||
self.mail_to = mail_to
|
||||
self.mail_subject = mail_subject
|
||||
self.mail_nearby_landing_subject = mail_nearby_landing_subject
|
||||
self.station_position = station_position
|
||||
self.launch_notifications = launch_notifications
|
||||
self.landing_notifications = landing_notifications
|
||||
|
|
@ -266,7 +268,11 @@ class EmailNotification(object):
|
|||
% strip_sonde_serial(_id)
|
||||
)
|
||||
|
||||
_subject = "Nearby Radiosonde Landing Detected - %s" % _id
|
||||
# Construct subject
|
||||
_subject = self.mail_nearby_landing_subject
|
||||
_subject = _subject.replace("<id>", _id)
|
||||
_subject = _subject.replace("<type>", telemetry["type"])
|
||||
_subject = _subject.replace("<freq>", telemetry["freq"])
|
||||
|
||||
self.send_notification_email(subject=_subject, message=msg)
|
||||
|
||||
|
|
@ -401,6 +407,7 @@ if __name__ == "__main__":
|
|||
mail_from=config["email_from"],
|
||||
mail_to=config["email_to"],
|
||||
mail_subject=config["email_subject"],
|
||||
mail_nearby_landing_subject=config["email_nearby_landing_subject"],
|
||||
station_position=(-10.0, 10.0, 0.0,),
|
||||
landing_notifications=True,
|
||||
launch_notifications=True,
|
||||
|
|
|
|||
|
|
@ -357,6 +357,12 @@ to = someone@example.com
|
|||
# <id> - Sonde Serial Number (i.e. M1234567)
|
||||
subject = <type> Sonde launch detected on <freq>: <id>
|
||||
|
||||
# Custom nearby landing subject field. The following fields can be included:
|
||||
# <freq> - Sonde Frequency, i.e. 401.520 MHz
|
||||
# <type> - Sonde Type (RS94/RS41)
|
||||
# <id> - Sonde Serial Number (i.e. M1234567)
|
||||
nearby_landing_subject = Nearby Radiosonde Landing Detected - <id>
|
||||
|
||||
|
||||
###################
|
||||
# ROTATOR CONTROL #
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue