example topics and start of the script

This commit is contained in:
Nat Morris
2016-11-15 01:21:51 +00:00
parent d33cd406ad
commit b8d7dc7c62
2 changed files with 117 additions and 2 deletions

33
aaisp-to-mqtt.py Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env python
import os
import sys
import logging
import json
import urllib
import configparser
LOG = logging.getLogger(__name__)
VERSION = 0.1
def main():
logging.basicConfig(level=logging.INFO, format='%(levelname)8s [%(asctime)s] %(message)s')
if len(sys.argv) != 2:
LOG.fatal("Config file not supplied")
cfgfile = sys.argv[1]
config = configparser.ConfigParser()
config.read(cfgfile)
for section in ["aaisp", "mqtt"]:
if section not in config.sections():
LOG.fatal("%s section not found in config file %s", section, cfgfile)
sys.exit(0)
if __name__ == "__main__":
main()