Round the altitude value

This commit is contained in:
mloebl 2018-03-18 17:50:19 -04:00 committed by GitHub
parent a4aae76fc5
commit e31774fcd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -295,8 +295,8 @@ def callback(packet):
if altitude: if altitude:
if METRICUNITS is "0": if METRICUNITS is "0":
altitude = altitude / 0.3048 altitude = altitude / 0.3048
logging.debug("altitude: %s", altitude) logging.debug("altitude: %s", round(altitude, 0))
publish_aprstomqtt(ssid, "altitude",altitude) publish_aprstomqtt(ssid, "altitude",round(altitude, 0))
comment = aprspacket.get('comment', None) comment = aprspacket.get('comment', None)
if comment: if comment:
@ -367,10 +367,6 @@ def aprs_connect():
aprs.consumer(callback, raw=True) aprs.consumer(callback, raw=True)
else: else:
aprs.consumer(callback) aprs.consumer(callback)
# Use the signal module to handle signals # Use the signal module to handle signals
signal.signal(signal.SIGTERM, cleanup) signal.signal(signal.SIGTERM, cleanup)