2022-12-19 10:35:20 +01:00
|
|
|
import config
|
|
|
|
import function
|
|
|
|
import logging
|
|
|
|
import mqtt
|
|
|
|
import report
|
|
|
|
import time
|
|
|
|
|
|
|
|
logger = logging.getLogger(config.APP_NAME)
|
|
|
|
|
2023-01-30 12:22:59 +01:00
|
|
|
# TODO: Extend virtual devices and implement all_off functionality in function.all_functions.init_off_functionality
|
2023-01-28 14:32:52 +01:00
|
|
|
# * All Off
|
|
|
|
# * ...
|
2023-01-30 12:22:59 +01:00
|
|
|
# TODO: Restructure nodered gui (own heating page - with circulation pump)
|
|
|
|
# TODO: Extend tests in simulation
|
|
|
|
# - 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)
|
|
|
|
# - Remote actions after amplifier on
|
|
|
|
# - Switching button functions (gfw_dirk, ffe.sleep)
|
|
|
|
# - Heating functionality (base: set temp, set default, away_mode, summer_mode, start and stop boost)
|
|
|
|
# - Brightness button functions (gfw.dirk, ffe.sleep)
|
|
|
|
# - Motion stairways (incl. sensor feedback)
|
|
|
|
# - Heating functionality (extended: timer)
|
|
|
|
# - Timer (circulation and stairways)
|
2023-01-28 14:32:52 +01:00
|
|
|
# TODO: Rework devices to base.mqtt (pack -> set, ...)
|
|
|
|
# TODO: Implement handling of warnings (videv element to show in webapp?)
|
|
|
|
|
2022-12-19 10:35:20 +01:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
if config.DEBUG:
|
2022-12-25 16:31:22 +01:00
|
|
|
report.appLoggingConfigure(None, None, ((config.APP_NAME, logging.DEBUG), ), fmt=report.SHORT_FMT, host='localhost', port=19996)
|
2022-12-19 10:35:20 +01:00
|
|
|
else:
|
2022-12-26 09:56:56 +01:00
|
|
|
report.stdoutLoggingConfigure(((config.APP_NAME, logging.INFO), ), report.SHORT_FMT)
|
2022-12-19 10:35:20 +01:00
|
|
|
#
|
2022-12-25 16:31:22 +01:00
|
|
|
mc = mqtt.mqtt_client(host=config.MQTT_SERVER, port=config.MQTT_PORT, username=config.MQTT_USER,
|
|
|
|
password=config.MQTT_PASSWORD, name=config.APP_NAME)
|
2022-12-19 10:35:20 +01:00
|
|
|
|
2022-12-19 16:11:35 +01:00
|
|
|
func = function.all_functions(mc)
|
2022-12-19 10:35:20 +01:00
|
|
|
|
|
|
|
while (True):
|
|
|
|
time.sleep(1)
|