From 34ba0f0d01d36f93ad7c870b181ab1ccacadcb8d Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Mon, 6 Feb 2023 12:42:44 +0100 Subject: [PATCH] Slight rework of heating function --- function/__init__.py | 3 --- function/first_floor_east.py | 2 +- function/first_floor_west.py | 2 +- function/ground_floor_west.py | 4 ++-- function/modules.py | 11 ++++++----- function/videv.py | 4 ++-- smart_brain.py | 13 +------------ 7 files changed, 13 insertions(+), 26 deletions(-) diff --git a/function/__init__.py b/function/__init__.py index 1a61278..f224ed6 100644 --- a/function/__init__.py +++ b/function/__init__.py @@ -18,9 +18,6 @@ except ImportError: ROOT_LOGGER_NAME = 'root' logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__) -# TODO: implement garland (incl. day events like sunset, sunrise, ...) -# TODO: implement warning message - class all_functions(room_collection): def __init__(self, mqtt_client): diff --git a/function/first_floor_east.py b/function/first_floor_east.py index ed51fdb..ff80852 100644 --- a/function/first_floor_east.py +++ b/function/first_floor_east.py @@ -144,7 +144,7 @@ class first_floor_east_sleep(room): self.bed_light_ma_powerplug.toggle_output_0_mcb) # heating function - self.heating_function = heating_function(self.heating_valve, config.DEFAULT_TEMPERATURE_FFE_SLEEP) + self.heating_function = heating_function(self.heating_valve) # # Virtual Device Interface diff --git a/function/first_floor_west.py b/function/first_floor_west.py index 517c746..37d406b 100644 --- a/function/first_floor_west.py +++ b/function/first_floor_west.py @@ -58,7 +58,7 @@ class first_floor_west_bath(room): # Functionality initialisation # # heating function - self.heating_function = heating_function(self.heating_valve, config.DEFAULT_TEMPERATURE_FFW_BATH) + self.heating_function = heating_function(self.heating_valve) # # Virtual Device Interface diff --git a/function/ground_floor_west.py b/function/ground_floor_west.py index 990fc60..fd2afea 100644 --- a/function/ground_floor_west.py +++ b/function/ground_floor_west.py @@ -69,7 +69,7 @@ class ground_floor_west_marion(room): # Functionality initialisation # # heating function - self.heating_function = heating_function(self.heating_valve, config.DEFAULT_TEMPERATURE_GFW_MARION) + self.heating_function = heating_function(self.heating_valve) # # Virtual Device Interface @@ -150,7 +150,7 @@ class ground_floor_west_dirk(room): self.audio_source = self.AUDIO_SOURCE_PC # heating function - self.heating_function = heating_function(self.heating_valve, config.DEFAULT_TEMPERATURE_GFW_DIRK) + self.heating_function = heating_function(self.heating_valve) # # Virtual Device Interface diff --git a/function/modules.py b/function/modules.py index 18ad762..f5db6cb 100644 --- a/function/modules.py +++ b/function/modules.py @@ -12,6 +12,7 @@ Targets: """ from base import common_base +import config import devices from function.db import get_radiator_data, set_radiator_data from function.helpers import now, sunset_time, sunrise_time @@ -152,11 +153,13 @@ class heating_function(common_base): AWAY_REDUCTION = 5 SUMMER_TEMPERATURE = 5 - def __init__(self, heating_valve, default_temperature): + def __init__(self, heating_valve): + self.heating_valve = heating_valve + self.default_temperature = config.DEFAULT_TEMPERATURE[heating_valve.topic] db_data = get_radiator_data(heating_valve.topic) super().__init__({ - self.KEY_USER_TEMPERATURE_SETPOINT: db_data[2] or default_temperature, - self.KEY_TEMPERATURE_SETPOINT: db_data[3] or default_temperature, + self.KEY_USER_TEMPERATURE_SETPOINT: db_data[2] or self.default_temperature, + self.KEY_TEMPERATURE_SETPOINT: db_data[3] or self.default_temperature, self.KEY_TEMPERATURE_CURRENT: None, self.KEY_AWAY_MODE: db_data[0] or False, self.KEY_SUMMER_MODE: db_data[1] or False, @@ -165,8 +168,6 @@ class heating_function(common_base): self.KEY_BOOST_TIMER: 0 }) # - self.default_temperature = default_temperature - self.heating_valve = heating_valve self.heating_valve.set_heating_setpoint(self[self.KEY_TEMPERATURE_SETPOINT]) # self.heating_valve.add_callback(self.heating_valve.KEY_HEATING_SETPOINT, None, self.get_radiator_setpoint) diff --git a/function/videv.py b/function/videv.py index 21d32d0..5fbe6e6 100644 --- a/function/videv.py +++ b/function/videv.py @@ -5,8 +5,8 @@ Virtual Device(s) Targets: - * MQTT-Interface to control joined devices as one virtual device. - * Primary signal routing + * MQTT-Interface to control joined devices as one virtual device + * Primary signal routing * No functionality should be implemented here """ diff --git a/smart_brain.py b/smart_brain.py index 781bb8f..f328954 100644 --- a/smart_brain.py +++ b/smart_brain.py @@ -7,21 +7,10 @@ import time logger = logging.getLogger(config.APP_NAME) -# TODO: Extend virtual devices and implement all_off functionality in function.all_functions.init_off_functionality -# * All Off -# * ... # 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) # TODO: Rework devices to base.mqtt (pack -> set, ...) # TODO: Implement handling of warnings (videv element to show in webapp?) +# TODO: implement garland (incl. day events like sunset, sunrise, ...) if __name__ == "__main__":