16 lines
439 B
Python
16 lines
439 B
Python
|
#!/usr/bin/python3
|
||
|
from controller import Controller
|
||
|
from argparse import ArgumentParser
|
||
|
|
||
|
parser = ArgumentParser(description="MQTT Control of RPI.")
|
||
|
parser.add_argument(dest="host",type=str,help="Host name of the MQTT broker")
|
||
|
parser.add_argument(dest="topic",type=str,help="set the base topic")
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
args = parser.parse_args()
|
||
|
controller = Controller(args.topic,args.host)
|
||
|
controller.loop_forever()
|