Execute a command on receiving a mqtt message
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

config.py 894B

12345678910111213141516171819202122232425262728293031323334353637
  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. ENABLED_TOPIC = 'topic'
  10. EXEC_LIST = {
  11. 'topic_1': {
  12. 'key': 'key', # Give a key or None to compare plain DATA
  13. 'data': 'data', # Give data to compare or None if no comparison is needed
  14. 'command': 'echo 123'
  15. },
  16. 'topic_2': {
  17. 'key': None, # Give a key or None to compare plain DATA
  18. 'data': 'data', # Give data to compare or None if no comparison is needed
  19. 'command': 'echo 321'
  20. }
  21. }
  22. #
  23. # Logging
  24. #
  25. APP_NAME = "exec_command"
  26. LOGTARGET = 'stdout' # possible choices are: 'logfile' or 'stdout'
  27. LOGLVL = 'DEBUG'
  28. LOGHOST = 'cutelog'
  29. LOGPORT = 19996
  30. formatter = report.SHORT_FMT