Skip to content

Commit

Permalink
Update radon_reader.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ceandre authored Sep 13, 2019
1 parent 81684bf commit dd7a0d6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions radon_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
""" radon_reader.py: RadonEye RD200 (Bluetooth/BLE) Reader """

__progname__ = "RadonEye RD200 (Bluetooth/BLE) Reader"
__version__ = "0.3.5"
__version__ = "0.3.6"
__author__ = "Carlos Andre"
__email__ = "candrecn at hotmail dot com"
__date__ = "2019-09-09"
Expand All @@ -16,16 +16,16 @@
from random import randint

parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,description=__progname__)
parser.add_argument('-a','--address',help='Bluetooth Address (AA:BB:CC:DD:EE:FF format)',required=True)
parser.add_argument('-a',dest='address',help='Bluetooth Address (AA:BB:CC:DD:EE:FF format)',required=True)
parser.add_argument('-b','--becquerel',action='store_true',help='Display radon value in Becquerel (Bq/m^3) unit', required=False)
parser.add_argument('-v','--verbose',action='store_true',help='Verbose mode', required=False)
parser.add_argument('-s','--silent',action='store_true',help='Only output radon value (without unit and timestamp)', required=False)
parser.add_argument('-m','--mqtt',action='store_true',help='Enable send output to MQTT server', required=False)
parser.add_argument('-ms','--mqtt_srv',help='MQTT server URL or IP address', required=False)
parser.add_argument('-mp','--mqtt_port',help='MQTT server service port (Default: 1883)', required=False, default=1883)
parser.add_argument('-mu','--mqtt_user',help='MQTT server username', required=False)
parser.add_argument('-mw','--mqtt_pw',help='MQTT server password', required=False)
parser.add_argument('-ma','--mqtt_ha',action='store_true',help='Home Assistant MQTT server output (Default: EmonCMS)', required=False)
parser.add_argument('-ms',dest='mqtt_srv',help='MQTT server URL or IP address', required=False)
parser.add_argument('-mp',dest='mqtt_port',help='MQTT server service port (Default: 1883)', required=False, default=1883)
parser.add_argument('-mu',dest='mqtt_user',help='MQTT server username', required=False)
parser.add_argument('-mw',dest='mqtt_pw',help='MQTT server password', required=False)
parser.add_argument('-ma',dest='mqtt_ha',action='store_true',help='Enable Home Assistant MQTT output (Default: EmonCMS)', required=False)
args = parser.parse_args()

args.address = args.address.upper()
Expand Down Expand Up @@ -104,6 +104,7 @@ def GetRadonValue():

try:
GetRadonValue()

except Exception as e:
if args.verbose and not args.silent:
print (e)
Expand Down

0 comments on commit dd7a0d6

Please sign in to comment.