Execute a command on receiving a mqtt message
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

config.py 869B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env python
  2. # -*- coding: UTF-8 -*-
  3. import os
  4. import report
  5. __BASEPATH__ = os.path.abspath(os.path.dirname(__file__))
  6. MQTT_USER = "user"
  7. MQTT_PASS = "pass"
  8. MQTT_SERVER = "host"
  9. EXEC_LIST = {
  10. 'topic_1': {
  11. 'key': 'key', # Give a key or None to compare plain DATA
  12. 'data': 'data', # Give data to compare or None if no comparison is needed
  13. 'command': 'echo 123'
  14. },
  15. 'topic_2': {
  16. 'key': None, # Give a key or None to compare plain DATA
  17. 'data': 'data', # Give data to compare or None if no comparison is needed
  18. 'command': 'echo 321'
  19. }
  20. }
  21. #
  22. # Logging
  23. #
  24. APP_NAME = "exec_command"
  25. LOGTARGET = 'stdout' # possible choices are: 'logfile' or 'stdout'
  26. LOGLVL = 'DEBUG'
  27. LOGHOST = 'cutelog'
  28. LOGPORT = 19996
  29. formatter = report.SHORT_FMT