Skip to content

Commit

Permalink
Fixed typos and replace -h argument
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmohr committed Apr 21, 2018
1 parent 98b8c49 commit 4477eca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions raspberrypi-mqtt-light-sensor/raspberrypi-mqtt-light-sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ def mqtt_publish(mqtt_server, topic, value):
parser.add_argument('-p', '--pin', required=False,
help='Defines the GPIO pin used.')

parser.add_argument('-h', '--host', required=False,
parser.add_argument('-m', '--mqtt-host', required=False,
help='Defines the MQTT server.')

parser.add_argument('-s', '--seconds', required=True,
parser.add_argument('-s', '--seconds', required=False,
help='How long the measurement is before mqtt push. Values will be averaged.')

parser.add_argument('-t', '--topic', required=True,
parser.add_argument('-t', '--topic', required=False,
help='Defines the mqtt topic.')

args = parser.parse_args()
Expand All @@ -90,8 +90,8 @@ def mqtt_publish(mqtt_server, topic, value):
if args.seconds is not None:
__MIN_TIME_SECONDS = args.seconds

if args.host is not None:
__MQTT_SERVER = args.host
if args.mqtt_host is not None:
__MQTT_SERVER = args.mqtt_host

if args.topic is not None:
__MQTT_TOPIC = args.topic
Expand Down

0 comments on commit 4477eca

Please sign in to comment.