Smarthome Functionen
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.

smart_brain.py 962B

12345678910111213141516171819202122232425262728293031
  1. import config
  2. import function
  3. import logging
  4. import mqtt
  5. import report
  6. import time
  7. logger = logging.getLogger(config.APP_NAME)
  8. # TODO: Change Nodered topics to videv
  9. # TODO: Extend virtual devices
  10. # * All Off
  11. # * ...
  12. # TODO: Remove gui from rooms and devices
  13. # TODO: Rework devices to base.mqtt (pack -> set, ...)
  14. # TODO: Implement handling of warnings (videv element to show in webapp?)
  15. if __name__ == "__main__":
  16. if config.DEBUG:
  17. report.appLoggingConfigure(None, None, ((config.APP_NAME, logging.DEBUG), ), fmt=report.SHORT_FMT, host='localhost', port=19996)
  18. else:
  19. report.stdoutLoggingConfigure(((config.APP_NAME, logging.INFO), ), report.SHORT_FMT)
  20. #
  21. mc = mqtt.mqtt_client(host=config.MQTT_SERVER, port=config.MQTT_PORT, username=config.MQTT_USER,
  22. password=config.MQTT_PASSWORD, name=config.APP_NAME)
  23. func = function.all_functions(mc)
  24. while (True):
  25. time.sleep(1)