Publishs ambient information to mqtt server
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536
  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_SERVER = "{{ smart_sat_ambientinfo_hostname }}"
  7. MQTT_USER = "{{ smart_sat_ambientinfo_username }}"
  8. MQTT_PASS = "{{ smart_sat_ambientinfo_password }}"
  9. MQTT_TOPIC = "{{ smart_sat_ambientinfo_topic }}"
  10. DAT_PATH_DHT = None # os.path.join(__BASEPATH__, 'dat', 'dht')
  11. DAT_PATH_BMP = None # os.path.join(__BASEPATH__, 'dat', 'bmp')
  12. try:
  13. import board
  14. except ImportError:
  15. DHT_22_PORT = 4
  16. USE_PULSE_IO = True
  17. else:
  18. # DHT-PORT
  19. DHT_22_PORT = board.D4
  20. #
  21. # Logging
  22. #
  23. APP_NAME = "ambient_info"
  24. LOGTARGET = 'stdout' # possible choices are: 'logfile' or 'stdout'
  25. LOGLVL = 'WARNING'
  26. LOGHOST = 'cutelog'
  27. LOGPORT = 19996
  28. formatter = report.SHORT_FMT