mqtt.py 402 B

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. """
  3. demeter web
  4. name:admin.py
  5. author:rabin
  6. """
  7. from demeter.core import *
  8. param = {}
  9. param['method'] = 'm'
  10. param['topic'] = 't'
  11. Demeter.getopt(param)
  12. #Demeter.echo(Demeter.option['method'])
  13. method = Demeter.option['method']
  14. if 'topic' in Demeter.option:
  15. Demeter.service(method, 'mqtt').load(Demeter.option['topic'])
  16. else:
  17. Demeter.service(method, 'mqtt').run()