Smarthome Functionen
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

smart_brain.py 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839
  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: Extend virtual devices and implement all_off functionality in function.all_functions.init_off_functionality
  9. # * All Off
  10. # * ...
  11. # TODO: Restructure nodered gui (own heating page - with circulation pump)
  12. # TODO: Extend tests in simulation
  13. # - Synch functions (ffe.livingroom.floorlamp [with main_light and 1-6], ffe.diningroom/floorlamp, ffe.dirk.amplifier (with spotify, mpd, cd_player), gfw.floor.main_light)
  14. # - Remote actions after amplifier on
  15. # - Switching button functions (gfw_dirk, ffe.sleep)
  16. # - Heating functionality (base: set temp, set default, away_mode, summer_mode, start and stop boost)
  17. # - Brightness button functions (gfw.dirk, ffe.sleep)
  18. # - Motion stairways (incl. sensor feedback)
  19. # - Heating functionality (extended: timer)
  20. # - Timer (circulation and stairways)
  21. # TODO: Rework devices to base.mqtt (pack -> set, ...)
  22. # TODO: Implement handling of warnings (videv element to show in webapp?)
  23. if __name__ == "__main__":
  24. if config.DEBUG:
  25. report.appLoggingConfigure(None, None, ((config.APP_NAME, logging.DEBUG), ), fmt=report.SHORT_FMT, host='localhost', port=19996)
  26. else:
  27. report.stdoutLoggingConfigure(((config.APP_NAME, logging.INFO), ), report.SHORT_FMT)
  28. #
  29. mc = mqtt.mqtt_client(host=config.MQTT_SERVER, port=config.MQTT_PORT, username=config.MQTT_USER,
  30. password=config.MQTT_PASSWORD, name=config.APP_NAME)
  31. func = function.all_functions(mc)
  32. while (True):
  33. time.sleep(1)