From b2e547cf5525ce14003176d428fc4afaeb95cd9d Mon Sep 17 00:00:00 2001 From: Pierrick C Date: Fri, 17 Aug 2018 23:53:56 +0200 Subject: [PATCH] Move data units and types dict from uart2mqtt module to cameteo_conf --- raspberry/python/cameteo_conf.py | 32 +++++++++++++++++++++++++++++++- raspberry/python/uart2mqtt.py | 26 -------------------------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/raspberry/python/cameteo_conf.py b/raspberry/python/cameteo_conf.py index b297da8..8c9e347 100644 --- a/raspberry/python/cameteo_conf.py +++ b/raspberry/python/cameteo_conf.py @@ -90,4 +90,34 @@ photo_extensions = {'jpeg': 'jpg', epd_font_file = parser['EPD'].get('epd_font_file' , fallback='/usr/share/fonts/truetype/freefont/FreeMono.ttf') epd_bold_font_file = parser['EPD'].get('epd_bold_font_file' , fallback='/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf') epd_italic_font_file = parser['EPD'].get('epd_italic_font_file' , fallback='/usr/share/fonts/truetype/freefont/FreeMonoOblique.ttf') -epd_rotate = min(int(parser['EPD'].get('epd_rotate', fallback=0)), 1) \ No newline at end of file +epd_rotate = min(int(parser['EPD'].get('epd_rotate', fallback=0)), 1) + +######## +# MISC # +######## + +# Dictionnary of data types and units +data_type = {'cput' : "AT", + 'temp': "AT", + 'time': "TIME", + 'hum': "RH", + 'press': "AP", + 'vbat': "VBAT", + 'lat': "COOR", + 'lon': "COOR", + 'alt': "ALTI", + 'pasl': "MSPL", + 'qual': "MISC", + 'age': "MISC"} +data_unit = {'cput' : "degC", + 'temp': "degC", + 'time': "", + 'hum': "%", + 'press': "hPa", + 'vbat': "V", + 'lat': "deg", + 'lon': "deg", + 'alt': "m", + 'pasl': "hPa", + 'qual': "", + 'age': "s"} diff --git a/raspberry/python/uart2mqtt.py b/raspberry/python/uart2mqtt.py index 5f28adf..acfe828 100644 --- a/raspberry/python/uart2mqtt.py +++ b/raspberry/python/uart2mqtt.py @@ -19,32 +19,6 @@ Transmit data from UART (GPIO) to MQTT broker """ __version__ = "0.2" -# Dictionnary of data types and units -data_type = {'cput' : "AT", - 'temp': "AT", - 'time': "TIME", - 'hum': "RH", - 'press': "AP", - 'vbat': "VBAT", - 'lat': "COOR", - 'lon': "COOR", - 'alt': "ALTI", - 'pasl': "MSPL", - 'qual': "MISC", - 'age': "MISC"} -data_unit = {'cput' : "degC", - 'temp': "degC", - 'time': "", - 'hum': "%", - 'press': "hPa", - 'vbat': "V", - 'lat': "deg", - 'lon': "deg", - 'alt': "m", - 'pasl': "hPa", - 'qual': "", - 'age': "s"} - ########### # Imports # ###########