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 METRICUNITS is "0":
altitude = altitude / 0.3048
logging.debug("altitude: %s", altitude)
publish_aprstomqtt(ssid, "altitude",altitude)
logging.debug("altitude: %s", round(altitude, 0))
publish_aprstomqtt(ssid, "altitude",round(altitude, 0))
comment = aprspacket.get('comment', None)
if comment:
@ -368,10 +368,6 @@ def aprs_connect():
else:
aprs.consumer(callback)
# Use the signal module to handle signals
signal.signal(signal.SIGTERM, cleanup)
signal.signal(signal.SIGINT, cleanup)